1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

Remove redundant entity notification

This commit is contained in:
David Bomba 2020-11-16 13:41:43 +11:00
parent 49e4e77290
commit a8f186c921
2 changed files with 4 additions and 8 deletions

View File

@ -56,8 +56,6 @@ class SendRecurring implements ShouldQueue
*/
public function handle() : void
{
info(" in the handle ");
// Generate Standard Invoice
$invoice = RecurringInvoiceToInvoiceFactory::create($this->recurring_invoice, $this->recurring_invoice->client);
@ -99,8 +97,9 @@ class SendRecurring implements ShouldQueue
$this->recurring_invoice->save();
if ($invoice->invitations->count() > 0)
event(new InvoiceWasEmailed($invoice->invitations->first(), $invoice->company, Ninja::eventVars()));
//this is duplicated!!
// if ($invoice->invitations->count() > 0)
// event(new InvoiceWasEmailed($invoice->invitations->first(), $invoice->company, Ninja::eventVars()));
}

View File

@ -60,12 +60,9 @@ class InvoiceEmailedNotification implements ShouldQueue
if (($key = array_search('mail', $methods)) !== false && $first_notification_sent === true) {
unset($methods[$key]);
//Fire mail notification here!!!
//This allows us better control of how we
//handle the mailer
EntitySentMailer::dispatch($event->invitation, 'invoice', $user, $event->invitation->company);
$first_notification_sent = false;
}
$notification->method = $methods;