From 148456b70d2ea49ae5c64ab691fd84eb552b9bcd Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 13 Mar 2023 16:51:03 +1100 Subject: [PATCH] Minor fixes for events for invoice was emailed --- app/Jobs/Ninja/SendReminders.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/Jobs/Ninja/SendReminders.php b/app/Jobs/Ninja/SendReminders.php index 33a0cdc9f1..47754da05b 100644 --- a/app/Jobs/Ninja/SendReminders.php +++ b/app/Jobs/Ninja/SendReminders.php @@ -214,13 +214,11 @@ class SendReminders implements ShouldQueue nlog('firing email'); EmailEntity::dispatch($invitation, $invitation->company, $template)->delay(10); + event(new InvoiceWasEmailed($invoice->invitations->first(), $invoice->company, Ninja::eventVars(), $template)); + } }); - if ($this->checkSendSetting($invoice, $template)) { - event(new InvoiceWasEmailed($invoice->invitations->first(), $invoice->company, Ninja::eventVars(), $template)); - } - $invoice->last_sent_date = now(); $invoice->next_send_date = $this->calculateNextSendDate($invoice);