mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Run mailer syncronously
This commit is contained in:
parent
c6c0bb4d4b
commit
e3e535e5b7
@ -615,7 +615,7 @@ class PaymentController extends BaseController
|
||||
}
|
||||
break;
|
||||
case 'email_receipt':
|
||||
$this->payment->service()->sendEmail();
|
||||
$payment->service()->sendEmail();
|
||||
|
||||
if (! $bulk) {
|
||||
return $this->itemResponse($payment);
|
||||
|
@ -36,14 +36,10 @@ class SendEmail
|
||||
|
||||
$contact = $this->payment->client->contacts()->first();
|
||||
|
||||
// if ($contact?->email)
|
||||
// EmailPayment::dispatch($this->payment, $this->payment->company, $contact)->delay(now()->addSeconds(2));
|
||||
|
||||
|
||||
$this->payment->invoices->sortByDesc('id')->first(function ($invoice) {
|
||||
$invoice->invitations->each(function ($invitation) {
|
||||
if (!$invitation->contact->trashed() && $invitation->contact->email) {
|
||||
EmailPayment::dispatch($this->payment, $this->payment->company, $invitation->contact)->delay(now()->addSeconds(2));
|
||||
EmailPayment::dispatch($this->payment, $this->payment->company, $invitation->contact);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user