mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-04 07:34:37 -04:00
Add Webhooks at send
This commit is contained in:
parent
73af36376a
commit
052ca31297
@ -70,7 +70,14 @@ class MarkSent extends AbstractService
|
||||
|
||||
if($fire_webhook)
|
||||
event('eloquent.updated: App\Models\Invoice', $this->invoice);
|
||||
|
||||
$subscriptions = Webhook::where('company_id', $invoice->company_id)
|
||||
->where('event_id', Webhook::EVENT_SENT_INVOICE)
|
||||
->exists();
|
||||
|
||||
if ($subscriptions) {
|
||||
WebhookHandler::dispatch(Webhook::EVENT_SENT_INVOICE, $this->invoice, $this->invoice->company, 'client')->delay(0);
|
||||
}
|
||||
|
||||
return $this->invoice->fresh();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user