mirror of https://github.com/docusealco/docuseal
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
1.1 KiB
25 lines
1.1 KiB
# frozen_string_literal: true
|
|
|
|
module TemplateWebhooks
|
|
def enqueue_template_created_webhooks(template)
|
|
WebhookUrls.for_template(template, 'template.created').each do |webhook_url|
|
|
SendTemplateCreatedWebhookRequestJob.perform_async('template_id' => template.id,
|
|
'webhook_url_id' => webhook_url.id)
|
|
end
|
|
end
|
|
|
|
def enqueue_template_updated_webhooks(template)
|
|
WebhookUrls.for_template(template, 'template.updated').each do |webhook_url|
|
|
SendTemplateUpdatedWebhookRequestJob.perform_async('template_id' => template.id,
|
|
'webhook_url_id' => webhook_url.id)
|
|
end
|
|
end
|
|
|
|
def enqueue_template_preferences_updated_webhooks(template)
|
|
WebhookUrls.for_template(template, 'template.preferences_updated').each do |webhook_url|
|
|
SendTemplatePreferencesUpdatedWebhookRequestJob.perform_async('template_id' => template.id,
|
|
'webhook_url_id' => webhook_url.id)
|
|
end
|
|
end
|
|
end
|