feat: Add webhook event support for macros (#11235)

Fixes https://github.com/chatwoot/chatwoot/issues/5968

We will not support custom payload in V1.
This commit is contained in:
Pranav
2025-04-02 20:26:55 -07:00
committed by GitHub
parent c35edc9c49
commit 8bf2081aff
6 changed files with 24 additions and 4 deletions

View File

@@ -62,4 +62,9 @@ class Macros::ExecutionService < ActionService
mb = Messages::MessageBuilder.new(@user, @conversation.reload, params)
mb.perform
end
def send_webhook_event(webhook_url)
payload = @conversation.webhook_data.merge(event: 'macro.executed')
WebhookJob.perform_later(webhook_url.first, payload)
end
end