From a321153a5a28e418855ed23cdc76d926c1caa181 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 1 Aug 2022 07:02:08 +1000 Subject: [PATCH] Add tag to all outbound emails --- app/Jobs/Mail/NinjaMailerJob.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Jobs/Mail/NinjaMailerJob.php b/app/Jobs/Mail/NinjaMailerJob.php index 2d87ba119dec..13f06281e112 100644 --- a/app/Jobs/Mail/NinjaMailerJob.php +++ b/app/Jobs/Mail/NinjaMailerJob.php @@ -100,6 +100,8 @@ class NinjaMailerJob implements ShouldQueue $this->nmo->mailable->replyTo($this->company->owner()->email, $this->company->owner()->present()->name()); } + $this->nmo->mailable->tag($this->company->company_key); + //send email try { nlog("trying to send to {$this->nmo->to_user->email} ". now()->toDateTimeString()); @@ -143,7 +145,7 @@ class NinjaMailerJob implements ShouldQueue $this->entityEmailFailed($message); /* Don't send postmark failures to Sentry */ - if(Ninja::isHosted() && (!$e instanceof ClientException)) + if(Ninja::isHosted() && (!$e instanceof ClientException || !$e instanceof \Symfony\Component\Mailer\Exception\HttpTransportException)) app('sentry')->captureException($e); } }