1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-09 20:52:56 +01:00

Disabled support for queues

This commit is contained in:
Hillel Coren 2017-01-24 16:16:06 +02:00
parent 50a77846c3
commit 87eb9e1216
5 changed files with 51 additions and 19 deletions

View File

@ -292,7 +292,7 @@ if (!defined('APP_NAME'))
define('NINJA_APP_URL', env('NINJA_APP_URL', 'https://app.invoiceninja.com'));
define('NINJA_DOCS_URL', env('NINJA_DOCS_URL', 'http://docs.invoiceninja.com/en/latest'));
define('NINJA_DATE', '2000-01-01');
define('NINJA_VERSION', '3.0.0' . env('NINJA_VERSION_SUFFIX'));
define('NINJA_VERSION', '3.0.1' . env('NINJA_VERSION_SUFFIX'));
define('SOCIAL_LINK_FACEBOOK', env('SOCIAL_LINK_FACEBOOK', 'https://www.facebook.com/invoiceninja'));
define('SOCIAL_LINK_TWITTER', env('SOCIAL_LINK_TWITTER', 'https://twitter.com/invoiceninja'));

View File

@ -185,9 +185,11 @@ class InvoiceApiController extends BaseAPIController
if ($isEmailInvoice) {
if ($payment) {
$this->dispatch(new SendPaymentEmail($payment));
app('App\Ninja\Mailers\ContactMailer')->sendPaymentConfirmation($payment);
//$this->dispatch(new SendPaymentEmail($payment));
} elseif ( ! $invoice->is_recurring) {
$this->dispatch(new SendInvoiceEmail($invoice));
app('App\Ninja\Mailers\ContactMailer')->sendInvoice($invoice);
//$this->dispatch(new SendInvoiceEmail($invoice));
}
}

View File

@ -415,8 +415,9 @@ class InvoiceController extends BaseController
if ($invoice->is_recurring) {
$response = $this->emailRecurringInvoice($invoice);
} else {
$this->dispatch(new SendInvoiceEmail($invoice, false, $pdfUpload));
return true;
return app('App\Ninja\Mailers\ContactMailer')->sendInvoice($invoice, false, $pdfUpload);
//$this->dispatch(new SendInvoiceEmail($invoice, false, $pdfUpload));
//return true;
}
if ($response === true) {
@ -446,8 +447,9 @@ class InvoiceController extends BaseController
if ($invoice->isPaid()) {
return true;
} else {
$this->dispatch(new SendInvoiceEmail($invoice));
return true;
return app('App\Ninja\Mailers\ContactMailer')->sendInvoice($invoice);
//$this->dispatch(new SendInvoiceEmail($invoice));
//return true;
}
}

View File

@ -1,20 +1,46 @@
<?php namespace App\Listeners;
use App\Ninja\Mailers\UserMailer;
use App\Ninja\Mailers\ContactMailer;
use App\Events\InvoiceWasEmailed;
use App\Events\QuoteWasEmailed;
use App\Events\InvoiceInvitationWasViewed;
use App\Events\QuoteInvitationWasViewed;
use App\Events\QuoteInvitationWasApproved;
use App\Events\PaymentWasCreated;
use App\Jobs\SendPaymentEmail;
use App\Jobs\SendNotificationEmail;
use App\Jobs\SendPushNotification;
use App\Services\PushService;
/**
* Class NotificationListener
*/
class NotificationListener
{
/**
* @var UserMailer
*/
protected $userMailer;
/**
* @var ContactMailer
*/
protected $contactMailer;
/**
* @var PushService
*/
protected $pushService;
/**
* NotificationListener constructor.
* @param UserMailer $userMailer
* @param ContactMailer $contactMailer
* @param PushService $pushService
*/
public function __construct(UserMailer $userMailer, ContactMailer $contactMailer, PushService $pushService)
{
$this->userMailer = $userMailer;
$this->contactMailer = $contactMailer;
$this->pushService = $pushService;
}
/**
* @param $invoice
* @param $type
@ -26,7 +52,7 @@ class NotificationListener
{
if ($user->{"notify_{$type}"})
{
dispatch(new SendNotificationEmail($user, $invoice, $type, $payment));
$this->userMailer->sendNotification($user, $invoice, $type, $payment);
}
}
}
@ -37,7 +63,7 @@ class NotificationListener
public function emailedInvoice(InvoiceWasEmailed $event)
{
$this->sendEmails($event->invoice, 'sent');
dispatch(new SendPushNotification($event->invoice, 'sent'));
$this->pushService->sendNotification($event->invoice, 'sent');
}
/**
@ -46,7 +72,7 @@ class NotificationListener
public function emailedQuote(QuoteWasEmailed $event)
{
$this->sendEmails($event->quote, 'sent');
dispatch(new SendPushNotification($event->quote, 'sent'));
$this->pushService->sendNotification($event->quote, 'sent');
}
/**
@ -59,7 +85,7 @@ class NotificationListener
}
$this->sendEmails($event->invoice, 'viewed');
dispatch(new SendPushNotification($event->invoice, 'viewed'));
$this->pushService->sendNotification($event->invoice, 'viewed');
}
/**
@ -72,7 +98,7 @@ class NotificationListener
}
$this->sendEmails($event->quote, 'viewed');
dispatch(new SendPushNotification($event->quote, 'viewed'));
$this->pushService->sendNotification($event->quote, 'viewed');
}
/**
@ -81,7 +107,7 @@ class NotificationListener
public function approvedQuote(QuoteInvitationWasApproved $event)
{
$this->sendEmails($event->quote, 'approved');
dispatch(new SendPushNotification($event->quote, 'approved'));
$this->pushService->sendNotification($event->quote, 'approved');
}
/**
@ -94,9 +120,10 @@ class NotificationListener
return;
}
$this->contactMailer->sendPaymentConfirmation($event->payment);
$this->sendEmails($event->payment->invoice, 'paid', $event->payment);
dispatch(new SendPaymentEmail($event->payment));
dispatch(new SendPushNotification($event->payment->invoice, 'paid'));
$this->pushService->sendNotification($event->payment->invoice, 'paid');
}
}

View File

@ -756,7 +756,8 @@ class InvoiceRepository extends BaseRepository
*/
public function emailInvoice(Invoice $invoice)
{
dispatch(new SendInvoiceEmail($invoice));
app('App\Ninja\Mailers\ContactMailer')->sendInvoice($invoice);
//dispatch(new SendInvoiceEmail($invoice));
}