diff --git a/app/Services/Invoice/MarkSent.php b/app/Services/Invoice/MarkSent.php index 38daae25d480..5f2e8ac321b8 100644 --- a/app/Services/Invoice/MarkSent.php +++ b/app/Services/Invoice/MarkSent.php @@ -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(); }