From 2ec4adc4c8a539f1d319848e7decde2438fc1b2f Mon Sep 17 00:00:00 2001 From: = Date: Sat, 7 Aug 2021 21:34:20 +1000 Subject: [PATCH] Fixes for account reference --- app/Models/Account.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Models/Account.php b/app/Models/Account.php index 60056ee0fa97..3d35069d6228 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -365,10 +365,10 @@ class Account extends BaseModel if(is_null(Cache::get("throttle_notified:{$this->key}"))) { $nmo = new NinjaMailerObject; - $nmo->mailable = new EmailQuotaExceeded($account->companies()->first()); - $nmo->company = $account->companies()->first(); - $nmo->settings = $account->companies()->first()->settings; - $nmo->to_user = $account->companies()->first()->owner(); + $nmo->mailable = new EmailQuotaExceeded($this->companies()->first()); + $nmo->company = $this->companies()->first(); + $nmo->settings = $this->companies()->first()->settings; + $nmo->to_user = $this->companies()->first()->owner(); NinjaMailerJob::dispatch($nmo); Cache::put("throttle_notified:{$this->key}", true, 60 * 24);