From 85b5398718943b3dbd0c622de7fd5f65d1d6f36b Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sat, 19 Aug 2023 16:44:17 +1000 Subject: [PATCH] Fixes for mailers --- app/Jobs/Mail/NinjaMailerJob.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Jobs/Mail/NinjaMailerJob.php b/app/Jobs/Mail/NinjaMailerJob.php index ee38fbb77181..eed243b27d91 100644 --- a/app/Jobs/Mail/NinjaMailerJob.php +++ b/app/Jobs/Mail/NinjaMailerJob.php @@ -51,7 +51,7 @@ class NinjaMailerJob implements ShouldQueue public $override; - /** @var \App\Models\Company $company | null **/ + /** @var null|\App\Models\Company $company **/ public ?Company $company; private $mailer; @@ -143,8 +143,6 @@ class NinjaMailerJob implements ShouldQueue LightLogs::create(new EmailSuccess($this->nmo->company->company_key)) ->send(); - $this->nmo = null; - $this->company = null; } catch(\Symfony\Component\Mime\Exception\RfcComplianceException $e) { nlog("Mailer failed with a Logic Exception {$e->getMessage()}"); $this->fail(); @@ -195,6 +193,9 @@ class NinjaMailerJob implements ShouldQueue $this->release($this->backoff()[$this->attempts()-1]); } + $this->nmo = null; + $this->company = null; + /*Clean up mailers*/ $this->cleanUpMailers(); }