Add tag to all outbound emails

This commit is contained in:
David Bomba 2022-08-01 07:02:08 +10:00
parent f4551245a9
commit a321153a5a

View File

@ -100,6 +100,8 @@ class NinjaMailerJob implements ShouldQueue
$this->nmo->mailable->replyTo($this->company->owner()->email, $this->company->owner()->present()->name()); $this->nmo->mailable->replyTo($this->company->owner()->email, $this->company->owner()->present()->name());
} }
$this->nmo->mailable->tag($this->company->company_key);
//send email //send email
try { try {
nlog("trying to send to {$this->nmo->to_user->email} ". now()->toDateTimeString()); nlog("trying to send to {$this->nmo->to_user->email} ". now()->toDateTimeString());
@ -143,7 +145,7 @@ class NinjaMailerJob implements ShouldQueue
$this->entityEmailFailed($message); $this->entityEmailFailed($message);
/* Don't send postmark failures to Sentry */ /* 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); app('sentry')->captureException($e);
} }
} }