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

Re-enable support for queues

This commit is contained in:
Hillel Coren 2017-02-02 14:02:50 +02:00
parent e0c5cb61a8
commit 06d281a216
2 changed files with 20 additions and 9 deletions

View File

@ -411,10 +411,13 @@ class InvoiceController extends BaseController
if ($invoice->is_recurring) { if ($invoice->is_recurring) {
$response = $this->emailRecurringInvoice($invoice); $response = $this->emailRecurringInvoice($invoice);
} else { } else {
app('App\Ninja\Mailers\ContactMailer')->sendInvoice($invoice, false, $pdfUpload); // TODO remove this with Laravel 5.3 (https://github.com/invoiceninja/invoiceninja/issues/1303)
$response = true; if (config('queue.default') === 'sync') {
//$this->dispatch(new SendInvoiceEmail($invoice, false, $pdfUpload)); $response = app('App\Ninja\Mailers\ContactMailer')->sendInvoice($invoice, false, $pdfUpload);
//return true; } else {
$this->dispatch(new SendInvoiceEmail($invoice, false, $pdfUpload));
$response = true;
}
} }
if ($response === true) { if ($response === true) {
@ -445,9 +448,13 @@ class InvoiceController extends BaseController
if ($invoice->isPaid()) { if ($invoice->isPaid()) {
return true; return true;
} else { } else {
return app('App\Ninja\Mailers\ContactMailer')->sendInvoice($invoice); // TODO remove this with Laravel 5.3 (https://github.com/invoiceninja/invoiceninja/issues/1303)
//$this->dispatch(new SendInvoiceEmail($invoice)); if (config('queue.default') === 'sync') {
//return true; return app('App\Ninja\Mailers\ContactMailer')->sendInvoice($invoice);
} else {
$this->dispatch(new SendInvoiceEmail($invoice));
return true;
}
} }
} }

View File

@ -779,8 +779,12 @@ class InvoiceRepository extends BaseRepository
*/ */
public function emailInvoice(Invoice $invoice) public function emailInvoice(Invoice $invoice)
{ {
app('App\Ninja\Mailers\ContactMailer')->sendInvoice($invoice); // TODO remove this with Laravel 5.3 (https://github.com/invoiceninja/invoiceninja/issues/1303)
//dispatch(new SendInvoiceEmail($invoice)); if (config('queue.default') === 'sync') {
app('App\Ninja\Mailers\ContactMailer')->sendInvoice($invoice);
} else {
dispatch(new SendInvoiceEmail($invoice));
}
} }
/** /**