From 0828ff9ce6b6993a1516415872c99c36e4b90cbd Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 3 Mar 2023 10:56:00 +1100 Subject: [PATCH] Avoid passing relations into mailer objectS --- app/Listeners/Invoice/InvoiceFailedEmailNotification.php | 6 ++---- lang/en/texts.php | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/Listeners/Invoice/InvoiceFailedEmailNotification.php b/app/Listeners/Invoice/InvoiceFailedEmailNotification.php index 4817a9cd3d38..922d5df2e9c7 100644 --- a/app/Listeners/Invoice/InvoiceFailedEmailNotification.php +++ b/app/Listeners/Invoice/InvoiceFailedEmailNotification.php @@ -22,8 +22,6 @@ class InvoiceFailedEmailNotification { use UserNotifies; - public $delay = 7; - public function __construct() { } @@ -51,8 +49,8 @@ class InvoiceFailedEmailNotification unset($methods[$key]); $nmo = new NinjaMailerObject; - $nmo->mailable = new NinjaMailer((new EntityFailedSendObject($event->invitation, 'invoice', $event->template, $event->message))->build()); - $nmo->company = $invoice->company; + $nmo->mailable = new NinjaMailer((new EntityFailedSendObject($event->invitation->withoutRelations(), 'invoice', $event->template, $event->message))->build()); + $nmo->company = $invoice->company->withoutRelations(); $nmo->settings = $invoice->company->settings; $nmo->to_user = $user; diff --git a/lang/en/texts.php b/lang/en/texts.php index c9ec4d4daa47..ff03778970f7 100644 --- a/lang/en/texts.php +++ b/lang/en/texts.php @@ -5011,6 +5011,7 @@ $LANG = array( 'add_company_logo' => 'Add Logo', 'add_stripe' => 'Add Stripe', 'invalid_coupon' => 'Invalid Coupon', + 'no_assigned_tasks' => 'No billable tasks for this project', );