diff --git a/app/Jobs/Mail/NinjaMailerJob.php b/app/Jobs/Mail/NinjaMailerJob.php index 2a0caf5a17..638b022163 100644 --- a/app/Jobs/Mail/NinjaMailerJob.php +++ b/app/Jobs/Mail/NinjaMailerJob.php @@ -394,6 +394,14 @@ class NinjaMailerJob implements ShouldQueue $this->mailer = 'mailgun'; $this->setHostedMailgunMailer(); return $this; + case 'ses': + $this->mailer = 'ses'; + $this->setHostedSesMailer(); + return $this; + // case 'client_ses': + // $this->mailer = 'ses'; + // $this->setSesMailer(); + // return $this; case 'gmail': $this->mailer = 'gmail'; $this->setGmailMailer(); @@ -430,6 +438,22 @@ class NinjaMailerJob implements ShouldQueue return $this; } + + private function setHostedSesMailer() + { + + if (property_exists($this->nmo->settings, 'email_from_name') && strlen($this->nmo->settings->email_from_name) > 1) { + $email_from_name = $this->nmo->settings->email_from_name; + } else { + $email_from_name = $this->company->present()->name(); + } + + $this->nmo + ->mailable + ->from(config('services.ses.from.address'), $email_from_name); + + } + private function configureSmtpMailer() { diff --git a/app/Services/Email/Email.php b/app/Services/Email/Email.php index da12cded99..17beead6a1 100644 --- a/app/Services/Email/Email.php +++ b/app/Services/Email/Email.php @@ -532,6 +532,20 @@ class Email implements ShouldQueue return false; } + private function setHostedSesMailer() + { + + if (property_exists($this->email_object->settings, 'email_from_name') && strlen($this->email_object->settings->email_from_name) > 1) { + $email_from_name = $this->email_object->settings->email_from_name; + } else { + $email_from_name = $this->company->present()->name(); + } + + $this->mailable + ->from(config('services.ses.from.address'), $email_from_name); + + } + private function setHostedMailgunMailer() { @@ -601,6 +615,10 @@ class Email implements ShouldQueue $this->mailer = 'mailgun'; $this->setHostedMailgunMailer(); return $this; + case 'ses': + $this->mailer = 'ses'; + $this->setHostedSesMailer(); + return $this; case 'gmail': $this->mailer = 'gmail'; $this->setGmailMailer(); diff --git a/lang/en/texts.php b/lang/en/texts.php index 07dfbd8fd0..7b97b75805 100644 --- a/lang/en/texts.php +++ b/lang/en/texts.php @@ -5622,6 +5622,10 @@ $lang = array( 'activity_151' => 'Client :notes merged into :client by :user', 'activity_152' => 'Vendor :notes merged into :vendor by :user', 'activity_153' => 'Client :notes purged by :user', + 'lifecycle' => 'Lifecycle', + 'order_columns' => 'Order Columns', + 'topic_arn' => 'Topic ARN', + ); return $lang;