mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fix for Zapier notifications
This commit is contained in:
parent
43cd7910f8
commit
b13e79ad85
@ -24,53 +24,33 @@ class SubscriptionListener
|
||||
{
|
||||
public function createdClient(ClientWasCreated $event)
|
||||
{
|
||||
if ( ! Auth::check()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$transformer = new ClientTransformer(Auth::user()->account);
|
||||
$transformer = new ClientTransformer($event->client->account);
|
||||
$this->checkSubscriptions(ACTIVITY_TYPE_CREATE_CLIENT, $event->client, $transformer);
|
||||
}
|
||||
|
||||
public function createdQuote(QuoteWasCreated $event)
|
||||
{
|
||||
if ( ! Auth::check()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$transformer = new InvoiceTransformer(Auth::user()->account);
|
||||
$transformer = new InvoiceTransformer($event->quote->account);
|
||||
$this->checkSubscriptions(ACTIVITY_TYPE_CREATE_QUOTE, $event->quote, $transformer, ENTITY_CLIENT);
|
||||
}
|
||||
|
||||
public function createdPayment(PaymentWasCreated $event)
|
||||
{
|
||||
if ( ! Auth::check()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$transformer = new PaymentTransformer(Auth::user()->account);
|
||||
$transformer = new PaymentTransformer($event->payment->account);
|
||||
$this->checkSubscriptions(ACTIVITY_TYPE_CREATE_PAYMENT, $event->payment, $transformer, [ENTITY_CLIENT, ENTITY_INVOICE]);
|
||||
}
|
||||
|
||||
public function createdCredit(CreditWasCreated $event)
|
||||
{
|
||||
if ( ! Auth::check()) {
|
||||
return;
|
||||
}
|
||||
|
||||
//$this->checkSubscriptions(ACTIVITY_TYPE_CREATE_CREDIT, $event->credit);
|
||||
}
|
||||
|
||||
public function createdInvoice(InvoiceWasCreated $event)
|
||||
{
|
||||
if ( ! Auth::check()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$transformer = new InvoiceTransformer(Auth::user()->account);
|
||||
$transformer = new InvoiceTransformer($event->invoice->account);
|
||||
$this->checkSubscriptions(ACTIVITY_TYPE_CREATE_INVOICE, $event->invoice, $transformer, ENTITY_CLIENT);
|
||||
}
|
||||
|
||||
public function createdCredit(CreditWasCreated $event)
|
||||
{
|
||||
//$this->checkSubscriptions(ACTIVITY_TYPE_CREATE_CREDIT, $event->credit);
|
||||
}
|
||||
|
||||
public function createdVendor(VendorWasCreated $event)
|
||||
{
|
||||
//$this->checkSubscriptions(ACTIVITY_TYPE_CREATE_VENDOR, $event->vendor);
|
||||
|
Loading…
x
Reference in New Issue
Block a user