Samson Mutunga před 1 rokem
rodič
revize
c6b85aa381

+ 267 - 0
app/Http/Services/EmailService.php

@@ -0,0 +1,267 @@
+<?php
+
+namespace App\Http\Services;
+
+use App\Models\Invoice;
+use App\Models\FinancialTransaction;
+use Illuminate\Support\Facades\Http;
+use Illuminate\Support\Facades\View;
+
+
+use Barryvdh\DomPDF\Facade\Pdf;
+
+class EmailService
+{
+
+    protected $fromEmailAddress;
+    protected $emailFromName;
+    protected $secret;
+    public $appUrl;
+    public $appInternalName;
+    public $stringMappingConfig;
+
+    public function __construct()
+    {
+        $this->secret = 'b4mC2TeVuZqvcUv';
+        $this->fromEmailAddress = config('app.fromEmailAddress');
+        $this->emailFromName = config('app.emailFromName');
+        $this->appUrl = config('app.url');
+        $this->appInternalName = config('app.internalName');
+        $this->stringMappingConfig = config('constants.' . $this->appInternalName);
+    }
+
+    protected function callJava($endPoint, $data)
+    {
+        $data['apiKey'] = $this->secret;
+        $url = config('stag.backendUrl') . $endPoint;
+        $response =   Http::asForm()
+            ->withHeaders([
+                'sessionKey' => request()->cookie('sessionKey')
+            ])
+            ->post($url, $data)
+            ->body();
+
+        return json_decode($response, true);
+    }
+
+
+    //Emails
+
+    public function notifyClientOnNewInvoice(Invoice $invoice)
+    {
+        $clientEmailAddress = $invoice->customer->client->email_address;
+        if(!$clientEmailAddress) return;
+
+        $appInternalName = $this->appInternalName;
+        $stringMappingConfig = $this->stringMappingConfig;
+        $appUrl = $this->appUrl;
+        $emailFromName = $this->emailFromName;
+        $toEmailAddress = $clientEmailAddress;
+        $html = (string) view('emails.templates.invoice-created-email', compact('toEmailAddress', 'invoice', 'appUrl', 'emailFromName', 'appInternalName', 'stringMappingConfig'));
+        $plainText = '';
+
+        $params = [
+            'subject' => 'New Payment Request Added to Your Account',
+            'htmlBody' => $html,
+            'plainTextBody' => $plainText,
+            'toAddress' => $clientEmailAddress,
+            'fromEmail' => $this->fromEmailAddress,
+            'fromName' => $this->emailFromName,
+        ];
+
+        $response = $this->callJava('/email/send', $params);
+        return $response;
+    }
+
+    public function notifyClientOnInvoiceDeactivation(Invoice $invoice)
+    {
+        $clientEmailAddress = $invoice->customer->client->email_address;
+        if(!$clientEmailAddress) return;
+
+        $appInternalName = $this->appInternalName;
+        $stringMappingConfig = $this->stringMappingConfig;
+        $appUrl = $this->appUrl;
+        $emailFromName = $this->emailFromName;
+        $toEmailAddress = $clientEmailAddress;
+        $html = (string) view('emails.templates.invoice-deactivation-email', compact('toEmailAddress', 'invoice', 'appUrl', 'emailFromName', 'appInternalName', 'stringMappingConfig'));
+        $plainText = '';
+
+        $params = [
+            'subject' => 'Payment Request Cancellation Notice',
+            'htmlBody' => $html,
+            'plainTextBody' => $plainText,
+            'toAddress' => $clientEmailAddress,
+            'fromEmail' => $this->fromEmailAddress,
+            'fromName' => $this->emailFromName,
+        ];
+
+        $response = $this->callJava('/email/send', $params);
+        return $response;
+    }
+
+    public function notifyClientOnInvoicePayment(Invoice $invoice)
+    {
+        $clientEmailAddress = $invoice->customer->client->email_address;
+        if(!$clientEmailAddress) return;
+
+        $appInternalName = $this->appInternalName;
+        $stringMappingConfig = $this->stringMappingConfig;
+        $appUrl = $this->appUrl;
+        $emailFromName = $this->emailFromName;
+        $toEmailAddress = $clientEmailAddress;
+        $html = (string) view('emails.templates.invoice-payment-email', compact('toEmailAddress', 'invoice', 'appUrl', 'emailFromName', 'appInternalName', 'stringMappingConfig'));
+        $plainText = '';
+
+        $params = [
+            'subject' => 'Transaction Notification: Service Payment Confirmation',
+            'htmlBody' => $html,
+            'plainTextBody' => $plainText,
+            'toAddress' => $clientEmailAddress,
+            'fromEmail' => $this->fromEmailAddress,
+            'fromName' => $this->emailFromName,
+        ];
+
+        $response = $this->callJava('/email/send', $params);
+        return $response;
+    }
+
+    public function notifyClientOnFailedInvoicePayment(Invoice $invoice)
+    {
+        $clientEmailAddress = $invoice->customer->client->email_address;
+        if(!$clientEmailAddress) return;
+
+        $appInternalName = $this->appInternalName;
+        $stringMappingConfig = $this->stringMappingConfig;
+        $appUrl = $this->appUrl;
+        $emailFromName = $this->emailFromName;
+        $toEmailAddress = $clientEmailAddress;
+        $html = (string) view('emails.templates.invoice-failed-payment-email', compact('toEmailAddress', 'invoice', 'appUrl', 'emailFromName', 'appInternalName', 'stringMappingConfig'));
+        $plainText = '';
+
+        $params = [
+            'subject' => 'Payment Declined: Action Required',
+            'htmlBody' => $html,
+            'plainTextBody' => $plainText,
+            'toAddress' => $clientEmailAddress,
+            'fromEmail' => $this->fromEmailAddress,
+            'fromName' => $this->emailFromName,
+        ];
+
+        $response = $this->callJava('/email/send', $params);
+        return $response;
+    }
+
+
+    public function notifyClientOnRefundTransaction(FinancialTransaction $transaction)
+    {
+        $clientEmailAddress = $transaction->customer->client->email_address;
+        if(!$clientEmailAddress) return;
+
+        $appInternalName = $this->appInternalName;
+        $stringMappingConfig = $this->stringMappingConfig;
+        $appUrl = $this->appUrl;
+        $emailFromName = $this->emailFromName;
+        $toEmailAddress = $clientEmailAddress;
+        $html = (string) view('emails.templates.transaction-refund-email', compact('toEmailAddress', 'transaction', 'appUrl', 'emailFromName', 'appInternalName', 'stringMappingConfig'));
+        $plainText = '';
+
+        $params = [
+            'subject' => 'Refund Issued for Payment',
+            'htmlBody' => $html,
+            'plainTextBody' => $plainText,
+            'toAddress' => $clientEmailAddress,
+            'fromEmail' => $this->fromEmailAddress,
+            'fromName' => $this->emailFromName,
+        ];
+
+        $response = $this->callJava('/email/send', $params);
+        return $response;
+    }
+
+    public function notifyEmailOnClientChange($client, $message, $toEmailAddres, $toName)
+    {
+        if(config('app.env') !== 'production'){
+            $toEmailAddress = config('app.devEmailAddress');
+        }
+
+        if(!$toEmailAddress) return;
+        
+        $appInternalName = $this->appInternalName;
+        $stringMappingConfig = $this->stringMappingConfig;
+        $appUrl = $this->appUrl;
+        $emailFromName = $this->emailFromName;
+        $html = (string) view('emails.templates.notify-on-company-client-change-email', compact('toEmailAddress', 'message', 'toName', 'appUrl', 'emailFromName', 'appInternalName', 'stringMappingConfig'));
+        $plainText = '';
+
+        $params = [
+            'subject' => $client->displayName() . ' Information Update',
+            'htmlBody' => $html,
+            'plainTextBody' => $plainText,
+            'toAddress' => $toEmailAddress,
+            'fromEmail' => $this->fromEmailAddress,
+            'fromName' => $this->emailFromName,
+        ];
+
+        $response = $this->callJava('/email/send', $params);
+        return $response;
+    }
+
+    public function notifyOnCompanyClientChange($companyClient, $message, $toEmailAddres, $toName)
+    {
+        if(config('app.env') !== 'production'){
+            $toEmailAddress = config('app.devEmailAddress');
+        }
+
+        if(!$toEmailAddress) return;
+        
+        $appInternalName = $this->appInternalName;
+        $stringMappingConfig = $this->stringMappingConfig;
+        $appUrl = $this->appUrl;
+        $emailFromName = $this->emailFromName;
+        $html = (string) view('emails.templates.notify-on-company-client-change-email', compact('toEmailAddress', 'companyClient', 'message', 'toName', 'appUrl', 'emailFromName', 'appInternalName', 'stringMappingConfig'));
+        $plainText = '';
+
+        $params = [
+            'subject' => $companyClient->client->displayName() . ' Information Update | ' . $companyClient->company->name,
+            'htmlBody' => $html,
+            'plainTextBody' => $plainText,
+            'toAddress' => $toEmailAddress,
+            'fromEmail' => $this->fromEmailAddress,
+            'fromName' => $this->emailFromName,
+        ];
+
+        $response = $this->callJava('/email/send', $params);
+        return $response;
+    }
+
+    public function sendServerError($code)
+    {
+        $toEmailAddress = config('app.devEmailAddress');
+        if(!$toEmailAddress) return;
+
+        $emails = explode(',', $toEmailAddress);
+        
+        $appInternalName = $this->appInternalName;
+        $stringMappingConfig = $this->stringMappingConfig;
+        $appUrl = $this->appUrl;
+        $emailFromName = $this->emailFromName;
+        $html = (string) view('emails.templates.error-email', compact('toEmailAddress', 'code', 'appUrl', 'emailFromName', 'appInternalName', 'stringMappingConfig'));
+        $plainText = '';
+
+        foreach($emails as $email){
+            $email = preg_replace('/\s+/', '', $email);
+            $params = [
+                'subject' => 'Server Error - ' . $code,
+                'htmlBody' => $html,
+                'plainTextBody' => $plainText,
+                'toAddress' => $email,
+                'fromEmail' => $this->fromEmailAddress,
+                'fromName' => $this->emailFromName,
+            ];
+
+            $response = $this->callJava('/email/send', $params);
+        }
+        return;
+    }
+
+}

+ 8 - 0
config/constants.php

@@ -1,5 +1,13 @@
 <?php
 return [
+  'lh' => [
+    'name' => 'Leadership Health',
+    'supportEmail' => 'carelink@leadershiphealth.org',
+    'supportPhone' => '(800) 990-5491',
+    'logo' => '/app/lh/img/logo.png',
+    'logoWhite' => '/app/lh/img/logo_white.png',
+    'primaryColor' => '#2AB7CA',
+  ],
   'medicaid_states' => [
     "MEDICAID ALABAMA",
     "MEDICAID ALASKA",

binární
public/app/lh/logo-white.png


binární
public/app/lh/logo.png


+ 5 - 0
resources/views/emails/call-to-action-button.blade.php

@@ -0,0 +1,5 @@
+<?php
+  $appInternalName = config('app.internalName');
+  $appConfig = config('constants.' . $appInternalName);
+ ?>
+<p style="text-align:center; padding: 0"><a href="{{ $link }}" style="padding: 15px 0;color: #fff;text-decoration: none; font-weight:bold; width: 400px;display: block;margin: auto; text-align: center;background:{{$appConfig['primaryColor']}};border-radius: 5px;">{{$label}}</a> </p>

+ 352 - 0
resources/views/emails/layout.blade.php

@@ -0,0 +1,352 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<?php
+  $appInternalName = config('app.internalName');
+  $appConfig = config('constants.' . $appInternalName);
+ ?>
+<html xmlns="http://www.w3.org/1999/xhtml" style="color-scheme: light dark; supported-color-schemes: light dark;">
+<head>
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <meta name="x-apple-disable-message-reformatting">
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <meta name="color-scheme" content="light dark">
+    <meta name="supported-color-schemes" content="light dark">
+    <title></title>
+    <style type="text/css" rel="stylesheet" media="all">
+    /* Base ------------------------------ */
+
+    @import url('https://fonts.googleapis.com/css?family=Nunito+Sans:400,700&display=swap');
+    body {
+        width: 100% !important;
+        height: 100%;
+        margin: 0;
+        -webkit-text-size-adjust: none;
+    }
+
+    a {
+        color: #1C3D80;
+    }
+
+    a img {
+        border: none;
+    }
+
+    td {
+        word-break: break-word;
+    }
+
+    .preheader {
+        display: none !important;
+        visibility: hidden;
+        mso-hide: all;
+        font-size: 1px;
+        line-height: 1px;
+        max-height: 0;
+        max-width: 0;
+        opacity: 0;
+        overflow: hidden;
+    }
+    /* Type ------------------------------ */
+
+    body,
+    td,
+    th {
+        font-family:Arial, sans-serif;
+    }
+
+    h1 {
+        margin-top: 0;
+        color: #625F5F;
+        font-size: 22px;
+        font-weight: bold;
+        text-align: left;
+    }
+
+    h2 {
+        margin-top: 0;
+        color: #625F5F;
+        font-size: 16px;
+        font-weight: bold;
+        text-align: left;
+    }
+
+    h3 {
+        margin-top: 0;
+        color: #625F5F;
+        font-size: 16px;
+        font-weight: bold;
+        text-align: left;
+    }
+
+    td,
+    th {
+        font-size: 16px;
+        color: #625F5F;
+    }
+
+    ul,
+    ol,
+    blockquote {
+        margin: 24px 0 1.1875em;
+        font-size: 16px;
+        line-height: 1.625;
+    }
+
+    p {
+        margin: 24px 0 1.1875em;
+        line-height: 1.625;
+    }
+    /* Utilities ------------------------------ */
+
+    .align-right {
+        text-align: right;
+    }
+
+    .align-left {
+        text-align: left;
+    }
+
+    .align-center {
+        text-align: center;
+    }
+    /* Buttons ------------------------------ */
+
+    .button {
+        display: inline-block;
+        text-decoration: none;
+        border-radius: 3px;
+        box-shadow: 0 2px 3px rgba(0, 0, 0, 0.16);
+        -webkit-text-size-adjust: none;
+        box-sizing: border-box;
+    }
+
+    @media only screen and (max-width: 500px) {
+        .button {
+            width: 100% !important;
+            text-align: center !important;
+        }
+    }
+    /* Attribute list ------------------------------ */
+
+    .attributes {
+        margin: 0 0 21px;
+    }
+
+    .attributes_content {
+        background-color: #FFFFFF;
+        padding: 16px;
+    }
+
+    .attributes_item {
+        padding: 0;
+        vertical-align: top;
+    }
+
+    /* Data table ------------------------------ */
+
+    .table_wrapper {
+        width: 100%;
+        margin: 0;
+    }
+
+    .table_item {
+        padding: 10px 0;
+        color: #625F5F;
+        font-size: 15px;
+        line-height: 18px;
+    }
+
+    .table_heading {
+        padding-bottom: 8px;
+        border-bottom: 1px solid #EAEAEC;
+    }
+
+    .table_heading p {
+        margin: 0;
+        color: #85878E;
+        font-size: 12px;
+    }
+
+    body {
+        background-color: #FFFFFF;
+        color: #625F5F;
+    }
+
+    p {
+        color: #625F5F;
+    }
+
+    p.sub {
+        color: #6B6E76;
+    }
+
+    .email-wrapper {
+        width: 100%;
+        margin: 0;
+        padding: 0;
+        background-color: #FFFFFF;
+    }
+
+    .email-content {
+        margin: 0;
+        padding: 0;
+    }
+    /* Masthead ----------------------- */
+
+    .email-masthead {
+        padding: 20px;
+        text-align: left;
+    }
+
+    .email-masthead_name {
+        font-size: 16px;
+        font-weight: bold;
+        color: #A8AAAF;
+        text-decoration: none;
+        text-shadow: 0 1px 0 white;
+    }
+    /* Body ------------------------------ */
+
+    .email-body {
+        margin: 0;
+        padding: 0;
+        background-color: #FFFFFF;
+    }
+
+    .email-body_inner {
+        width: 650px;
+        margin: 0 auto;
+        padding: 0;
+        background-color: #FFFFFF;
+    }
+
+    .email-footer {
+        width: 650px;
+        margin: 0 auto;
+        padding: 0;
+        text-align: center;
+    }
+
+    .email-footer p {
+        color: #6B6E76;
+    }
+
+    .email-footer a {
+        color: #6B6E76;
+        text-decoration: underline;
+    }
+
+    .body-action {
+        width: 100%;
+        margin: 30px auto;
+        padding: 0;
+        text-align: center;
+    }
+
+    .body-image {
+        width: 100%;
+        padding: 0;
+    }
+
+    .body-side-image {
+        width: 100%;
+        padding: 0;
+    }
+
+    .body-gallery {;
+        padding: 0;
+    }
+
+    .body-side-image p,
+    .body-gallery p {
+        color: #625F5F;
+        margin: 24px 0 24px;
+        line-height: 1.325;
+    }
+
+    .body-sub {
+        margin-top: 25px;
+        padding-top: 25px;
+        border-top: 1px solid #EAEAEC;
+    }
+
+    .content-cell {
+        padding: 35px;
+    }
+    /*Media Queries ------------------------------ */
+
+    @media only screen and (max-width: 650px) {
+        .email-body_inner,
+        .email-footer {
+            width: 100% !important;
+        }
+    }
+</style>
+    <!--[if mso]>
+    <style type="text/css">
+        .f-fallback  {
+            font-family: Arial, sans-serif;
+        }
+    </style>
+    <![endif]-->
+</head>
+<body style="background-color: #FFFFFF; color: #625F5F; font-family:Arial, sans-serif;">
+<table class="email-wrapper" width="100%" cellpadding="0" cellspacing="0" role="presentation" style="margin: 0; padding: 25px 0;" border="0" bgcolor="#FFFFFF">
+    <tr>
+        <td align="center" style="color: #625F5F; font-family:Arial, sans-serif; font-size: 16px; word-break: break-word;">
+            <table class="email-content" width="650" cellpadding="0" cellspacing="0" role="presentation" style="margin: 0; padding: 0;" border="0">
+                <tr>
+                    <td class="email-masthead" style="background-color:#ffffff;color: #625F5F; font-family:Arial, sans-serif; font-size: 16px; padding: 15px; text-align: center; word-break: break-word;">
+                        <img src="{{ config('app.url') }}/app/{{ $appInternalName }}/img/logo.png" alt=""  height="100"  style="border: none;max-width:400px;object-fit:contain;">
+                    </td>
+                </tr>
+                <!-- Email Body -->
+                <tr>
+                    <td class="email-body" width="650" cellpadding="0" cellspacing="0" style="color: #625F5F; font-family:Arial, sans-serif; font-size: 16px; margin: 0; padding: 0; word-break: break-word;" bgcolor="#FFFFFF">
+                        <table class="email-body_inner" align="center" width="650" cellpadding="0" cellspacing="0" role="presentation" style="margin: 0 auto; padding: 0;" border="0" bgcolor="#FFFFFF">
+                            <!-- Body content -->
+                            <tr>
+                                <td class="content-cell" style="color: #625F5F; font-family:Arial, sans-serif; font-size: 16px; padding: 15px 15px; word-break: break-word;">
+                                    <div class="f-fallback">
+
+
+                                        <p class="f-fallback" style=" font-weight: bold; color: #625F5F; font-size: 24px; padding: 0 15px; line-height: 24px; margin: 0 0 24px 0;">@yield('salutation')</p>
+
+                                        @yield('content')
+
+                                        <p class="f-fallback" style="color: #625F5F; font-size: 16px; padding: 0 15px; line-height: 24px; margin: 24px 0 0.1875em;">Thank you for choosing Sleep Care America. We look forward to providing you with excellent service and support.</p>
+
+                                        <p style="color: #625F5F; font-size: 15px; line-height: 24px; margin: 24px 0 1.1875em;padding: 0 15px;">Sincerely,
+                                          <br>
+                                          The {{$stringMappingConfig['name']}} Team
+                                        </p>
+                                    </div>
+                                </td>
+                            </tr>
+                            <tr>
+                                <td style="background:rgba(0,0,0,0.03) ;color: #625F5F; font-family:Arial, sans-serif; font-size: 16px; word-break: break-word;">
+                                    <table class="email-footer" align="center" width="650" cellpadding="0" cellspacing="0" role="presentation" style="margin: 0 auto; padding: 0; " border="0">
+                                        <tr>
+                                            <td class="content-cell" align="center" style="color: #625F5F; font-family:Arial, sans-serif; font-size: 16px; padding: 0;word-break: break-word;">
+                                                <p style="text-align:center;padding:15px 0 15px; margin:0;">
+                                                    <a target="_blank" href="{{ route('index') }}">Support</a>
+                                                    <span style="margin:0 10px;color:#cccccc;">|</span>
+                                                    <a target="_blank" href="{{ route('privacy-policy') }}">Privacy Policy</a>
+                                                    <span style="margin:0 10px;color:#cccccc;">|</span>
+                                                    <a target="_blank" href="{{ route('unsubscribe', @$account->uid?? @$toEmailAddress) }}">Unsubscribe</a>
+            
+                                                </p>
+                                                <p style="text-align: center;margin:0 0 15px 0;">Copyright © {{ date('Y') }} {{ config('app.name') }}. All Rights Reserved.</p>
+                                            </td>
+                                        </tr>
+                                    </table>
+                                </td>
+                            </tr>
+                        </table>
+                    </td>
+                </tr>
+            </table>
+        </td>
+    </tr>
+</table>
+</body>
+</html>

+ 7 - 0
resources/views/emails/preview-email.blade.php

@@ -0,0 +1,7 @@
+<div>
+    @foreach($fileNames as $fileName)
+        <div>
+            <a href="{{ route('preview-email', $fileName) }}" target="_blank">{{ $fileName }}</a>
+        </div>
+    @endforeach
+</div>

+ 14 - 0
resources/views/emails/templates/account-client-payment-method-added-email.blade.php

@@ -0,0 +1,14 @@
+@extends('emails.layout')
+<?php
+  $appInternalName = config('app.internalName');
+  $appConfig = config('constants.' . $appInternalName);
+ ?>
+@section('salutation')
+    Dear {{$client->displayName()}}!
+@endsection
+
+@section('content')
+    <p class="f-fallback" style="color: #625F5F; font-size: 16px; padding: 0 15px; line-height: 24px; margin: 24px 0 0.1875em;">We wanted to inform you that a new payment method has been successfully added to your Sleep Care America account. This secure payment information will streamline your experience, ensuring smooth and hassle-free transactions for your services.</p>
+    <p class="f-fallback" style="color: #625F5F; font-size: 16px; padding: 0 15px; line-height: 24px; margin: 24px 0 0.1875em;">Should you have any concerns about this update or require further assistance, please do not hesitate to reach out to our support team at <b>{{ config('app.phone') }}</b>.</p>
+
+@endsection

+ 16 - 0
resources/views/emails/templates/account-confirm-email.blade.php

@@ -0,0 +1,16 @@
+@extends('emails.layout')
+<?php
+  $appInternalName = config('app.internalName');
+  $appConfig = config('constants.' . $appInternalName);
+ ?>
+@section('salutation')
+    Welcome, {{$account->displayName()}}!
+@endsection
+
+@section('content')
+    <p class="f-fallback" style="color: #625F5F; font-size: 16px; padding: 0 15px; line-height: 24px; margin: 24px 0 0.1875em;">Thank you for signing up. We’re thrilled to have you onboard. Please click the link below to complete the process.</p>
+    <p class="f-fallback" style="color: #625F5F; font-size: 16px; padding: 0 15px; line-height: 24px; margin: 24px 0 0.1875em;">Confirmation Code: <b style="color:{{$appConfig['primaryColor']}}">{{$account->email_confirmation_token}}</b></p>
+
+    @include('emails.call-to-action-button', ['link'=> route('confirm-account-email', $account->email_confirmation_token), 'label' => 'Activate your account'])
+
+@endsection

+ 10 - 0
resources/views/emails/templates/account-notify-on-password-change-email.blade.php

@@ -0,0 +1,10 @@
+@extends('emails.layout')
+@section('salutation')
+    Hi, {{$account->displayName()}}!
+@endsection
+
+@section('content')
+    <p class="f-fallback" style="color: #625F5F; font-size: 17px; padding: 0 15px; line-height: 24px; margin: 24px 0 0.1875em;">This is to confirm that your password for Sleep Care America has been successfully updated. Your account security is our priority, and we want to ensure that your information remains protected.</p>
+    <p class="f-fallback" style="color: #625F5F; font-size: 17px; padding: 0 15px; line-height: 24px; margin: 24px 0 0.1875em;">If you did not initiate this change or have any concerns about the security of your account, please contact our support team immediately at <b>{{ config('app.phone') }}</b>.</p>
+
+@endsection

+ 18 - 0
resources/views/emails/templates/account-password-reset-email.blade.php

@@ -0,0 +1,18 @@
+@extends('emails.layout')
+<?php
+  $appInternalName = config('app.internalName');
+  $appConfig = config('constants.' . $appInternalName);
+ ?>
+@section('salutation')
+    Dear, {{$account->displayName()}}
+@endsection
+
+@section('content')
+    <p class="f-fallback" style="color: #625F5F; font-size: 16px; padding: 0 15px; line-height: 24px; margin: 24px 0 0.1875em;">We've received your request to reset your password for your Sleep Care America account. Your account security is important to us, and we're here to assist you.</p>
+    <p class="f-fallback" style="color: #625F5F; font-size: 16px; padding: 0 15px; line-height: 24px; margin: 24px 0 0.1875em;">To reset your password, please click the link below:</p>
+
+
+    @include('emails.call-to-action-button', ['link'=> route('reset-password', $account->password_reset_token), 'label' => 'Reset Password'])
+
+    <p class="f-fallback" style="color: #625F5F; font-size: 16px; padding: 0 15px; line-height: 24px; margin: 24px 0 0.1875em;">If you did not make this request or need further assistance, please contact our support team immediately by replying to this email or calling <a href="tel:{{ $stringMappingConfig['supportPhone'] }}" style="color:#000;text-decoration: none;font-size:16px;margin-left:7px;">{{ $stringMappingConfig['supportPhone'] }}</a>.</p>
+@endsection

+ 16 - 0
resources/views/emails/templates/account-request-change-email-email.blade.php

@@ -0,0 +1,16 @@
+@extends('emails.layout')
+<?php
+  $appInternalName = config('app.internalName');
+  $appConfig = config('constants.' . $appInternalName);
+ ?>
+@section('salutation')
+    Hi, {{$account->displayName()}}!
+@endsection
+
+@section('content')
+    <p class="f-fallback" style="color: #625F5F; font-size: 16px; padding: 0 15px; line-height: 24px; margin: 24px 0 0.1875em;">You have requested to change your account email address.</p>
+    <p class="f-fallback" style="color: #625F5F; font-size: 16px; padding: 0 15px; line-height: 24px; margin: 24px 0 0.1875em;">Verification Code: <b style="color:{{$appConfig['primaryColor']}}">{{$account->switch_email_confirmation_token}}</b></p>
+
+    @include('emails.call-to-action-button', ['link'=> route('settings.email-settings', $account->switch_email_confirmation_token), 'label' => 'Confirm Change Email Address'])
+
+@endsection

+ 18 - 0
resources/views/emails/templates/account-temporary-password-email.blade.php

@@ -0,0 +1,18 @@
+@extends('emails.layout')
+<?php
+  $appInternalName = config('app.internalName');
+  $appConfig = config('constants.' . $appInternalName);
+ ?>
+@section('salutation')
+    Welcome, {{$account->displayName()}}!
+@endsection
+
+@section('content')
+    <p class="f-fallback" style="color: #625F5F; font-size: 16px; padding: 0 15px; line-height: 24px; margin: 24px 0 0.1875em;">Thank you for signing up. We’re thrilled to have you onboard. Below is your temporary password to access your account.</p>
+    <p class="f-fallback" style="color: #625F5F; font-size: 16px; padding: 0 15px; line-height: 24px; margin: 24px 0 0.1875em;">Temporary Password: <b style="color:{{$appConfig['primaryColor']}}">{{$temporaryPassword}}</b></p>
+
+    @include('emails.call-to-action-button', ['link'=> route('my-account.dashboard'), 'label' => 'Access your account'])
+
+    <p style="color: #625F5F; font-size: 16px; padding: 0 15px; line-height: 24px; margin: 24px 0 0.1875em;">Please sign in to your account as soon as possible and change your password. Remember, never share your Sleep Care America password with anyone, including Sleep Care America support staff.</p>
+
+@endsection

+ 14 - 0
resources/views/emails/templates/notify-on-client-change-email.blade.php

@@ -0,0 +1,14 @@
+@extends('emails.layout')
+<?php
+$appInternalName = config('app.internalName');
+$appConfig = config('constants.' . $appInternalName);
+?>
+@section('salutation')
+    Hi, {{ $toName }}!
+@endsection
+
+@section('content')
+    <div class="f-fallback" style="color: #625F5F; background-color: #FFFFFF; padding: 0 15px; font-size: 16px; line-height: 24px; margin: 0;">
+        <p style="margin:0;"><?= $message ?></p>
+    </div>
+@endsection