{% extends "freeform/_layouts/settings" %} {% import "_includes/forms" as forms %} {% set title = "Webhooks"|t("freeform") %} {% set saveShortcutRedirect = 'freeform/settings/webhooks/{id}' %} {% set fullPageForm = true %} {% block actionButton %}
{% endblock %} {% block content %}
{{ redirectInput('freeform/settings/webhooks') }} {{ csrfInput() }} {% if webhook.id %} {% endif %} {{ forms.selectField({ first: true, label: "Type"|t('freeform'), instructions: "Choose the webhook type"|t('freeform'), name: 'type', id: 'webhook-type', value: webhook.type, errors: webhook.getErrors('type'), required: true, options: webhookTypes, }) }} {{ forms.textField({ label: "Webhook Name"|t('freeform'), instructions: "A name for this webhook"|t('freeform'), name: 'name', value: webhook.name, errors: webhook.getErrors('name'), autofocus: true, required: true, }) }} {{ forms.autosuggestField({ label: "Webhook URL"|t('freeform'), instructions: "Enter the Webhook URL."|t('freeform'), name: 'webhook', value: webhook.webhook, errors: webhook.getErrors('webhook'), required: true, suggestEnvVars: true, }) }} {{ forms.checkboxGroupField({ label: "Forms"|t('freeform'), instructions: "Select which forms will trigger this webhook."|t('freeform'), name: 'formIds', values: formIds, options: formList, errors: webhook.getErrors('formIds'), required: true, showAllOption: true, }) }} {% set slackType = "Solspace\\Freeform\\Webhooks\\Integrations\\Slack" %}
{{ forms.textareaField({ label: "Message"|t('freeform'), instructions: "Enter the notification message the Slack channel should receive. (Can use {{ submission }} and {{ form }} variables)"|t('freeform'), name: 'settings['~slackType~'][message]', value: webhook.settings ? webhook.settings.message : '', errors: webhook.getErrors('message'), required: true, rows: 10, }) }}
{% endblock %}