|
@@ -3,6 +3,7 @@
|
|
namespace App\Http\Services;
|
|
namespace App\Http\Services;
|
|
|
|
|
|
use App\Models\Appointment;
|
|
use App\Models\Appointment;
|
|
|
|
+use App\Models\AccountInvite;
|
|
use Illuminate\Support\Facades\Http;
|
|
use Illuminate\Support\Facades\Http;
|
|
use Illuminate\Support\Facades\View;
|
|
use Illuminate\Support\Facades\View;
|
|
|
|
|
|
@@ -131,4 +132,30 @@ class EmailService
|
|
return $response;
|
|
return $response;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public function notifyAccountInvite(AccountInvite $accountInvite)
|
|
|
|
+ {
|
|
|
|
+ $toEmailAddress = $this->getValidToEmailAddress($accountInvite->to_email_address);
|
|
|
|
+ if(!$toEmailAddress) return;
|
|
|
|
+
|
|
|
|
+ $appInternalName = $this->appInternalName;
|
|
|
|
+ $stringMappingConfig = $this->stringMappingConfig;
|
|
|
|
+ $appUrl = $this->appUrl;
|
|
|
|
+ $emailFromName = $this->emailFromName;
|
|
|
|
+ $toEmailAddress = $toEmailAddress;
|
|
|
|
+ $html = (string) view('emails.templates.account-invite', compact('toEmailAddress', 'accountInvite', 'appUrl', 'emailFromName', 'appInternalName', 'stringMappingConfig'));
|
|
|
|
+ $plainText = '';
|
|
|
|
+
|
|
|
|
+ $params = [
|
|
|
|
+ 'subject' => 'Account Invite',
|
|
|
|
+ 'htmlBody' => $html,
|
|
|
|
+ 'plainTextBody' => $plainText,
|
|
|
|
+ 'toAddress' => $toEmailAddress,
|
|
|
|
+ 'fromEmail' => $this->fromEmailAddress,
|
|
|
|
+ 'fromName' => $this->emailFromName,
|
|
|
|
+ ];
|
|
|
|
+
|
|
|
|
+ $response = $this->callJava('/email/send', $params);
|
|
|
|
+ return $response;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|