1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +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) {
$response = $this->emailRecurringInvoice($invoice);
} else {
app('App\Ninja\Mailers\ContactMailer')->sendInvoice($invoice, false, $pdfUpload);
$response = true;
//$this->dispatch(new SendInvoiceEmail($invoice, false, $pdfUpload));
//return true;
// TODO remove this with Laravel 5.3 (https://github.com/invoiceninja/invoiceninja/issues/1303)
if (config('queue.default') === 'sync') {
$response = app('App\Ninja\Mailers\ContactMailer')->sendInvoice($invoice, false, $pdfUpload);
} else {
$this->dispatch(new SendInvoiceEmail($invoice, false, $pdfUpload));
$response = true;
}
}
if ($response === true) {
@ -445,9 +448,13 @@ class InvoiceController extends BaseController
if ($invoice->isPaid()) {
return true;
} else {
return app('App\Ninja\Mailers\ContactMailer')->sendInvoice($invoice);
//$this->dispatch(new SendInvoiceEmail($invoice));
//return true;
// TODO remove this with Laravel 5.3 (https://github.com/invoiceninja/invoiceninja/issues/1303)
if (config('queue.default') === 'sync') {
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)
{
app('App\Ninja\Mailers\ContactMailer')->sendInvoice($invoice);
//dispatch(new SendInvoiceEmail($invoice));
// TODO remove this with Laravel 5.3 (https://github.com/invoiceninja/invoiceninja/issues/1303)
if (config('queue.default') === 'sync') {
app('App\Ninja\Mailers\ContactMailer')->sendInvoice($invoice);
} else {
dispatch(new SendInvoiceEmail($invoice));
}
}
/**