From 53a930f6c4f95970036ce09e4d59d324ea3f6029 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 30 Jun 2023 14:34:24 +1000 Subject: [PATCH] Fixes for returning mail providers --- app/Jobs/Mail/NinjaMailerJob.php | 10 ++++++---- app/Services/Email/Email.php | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/Jobs/Mail/NinjaMailerJob.php b/app/Jobs/Mail/NinjaMailerJob.php index 3b8611bb3f1e..39179844a0f8 100644 --- a/app/Jobs/Mail/NinjaMailerJob.php +++ b/app/Jobs/Mail/NinjaMailerJob.php @@ -243,19 +243,19 @@ class NinjaMailerJob implements ShouldQueue case 'gmail': $this->mailer = 'gmail'; $this->setGmailMailer(); - return; + return $this; case 'office365': $this->mailer = 'office365'; $this->setOfficeMailer(); - return; + return $this; case 'client_postmark': $this->mailer = 'postmark'; $this->setPostmarkMailer(); - return; + return $this; case 'client_mailgun': $this->mailer = 'mailgun'; $this->setMailgunMailer(); - return; + return $this; default: break; @@ -264,6 +264,8 @@ class NinjaMailerJob implements ShouldQueue if (Ninja::isSelfHost()) { $this->setSelfHostMultiMailer(); } + + return $this; } /** diff --git a/app/Services/Email/Email.php b/app/Services/Email/Email.php index ac606a0b2e9e..941d1c150b3f 100644 --- a/app/Services/Email/Email.php +++ b/app/Services/Email/Email.php @@ -445,7 +445,8 @@ class Email implements ShouldQueue return $this; default: - break; + $this->mailer = config('mail.default'); + return $this; } if (Ninja::isSelfHost()) {