{% extends 'formie/_layouts/settings' %} {% import '_includes/forms' as forms %} {% import 'verbb-base/_macros' as macros %} {% block content %}

{{ 'Spam Settings' | t('formie') }}

{{ 'Captchas' | t('formie') }}

{{ 'Looking for captchas? Find ReCAPTCHA and more under Integrations.' | t('formie', { href: url('formie/settings/captchas') }) | raw }}

{{ redirectInput('formie/settings/spam') }} {{ csrfInput() }} {% namespace 'settings' %} {{ forms.lightswitchField({ first: true, label: 'Save Spam Submissions' | t('formie'), instructions: 'Whether to save spam submissions, so they can be viewed in the control panel. Otherwise, spam submissions will be discarded.' | t('formie'), name: 'saveSpam', on: settings.saveSpam, toggle: 'save-spam', warning: macros.configWarning('saveSpam', 'formie'), }) }}
{{ forms.textField({ label: 'Spam Submission Limit' | t('formie'), instructions: 'Set the maximum number of spam submissions to maintain. Older spam submissions will be deleted.' | t('formie'), name: 'spamLimit', value: settings.spamLimit, warning: macros.configWarning('spamLimit', 'formie'), }) }} {{ forms.lightswitchField({ label: 'Send Email Notifications' | t('formie'), instructions: 'Whether submissions marked as spam should still trigger email notifications.' | t('formie'), name: 'spamEmailNotifications', on: settings.spamEmailNotifications, warning: macros.configWarning('spamEmailNotifications', 'formie'), }) }}

{{ forms.selectField({ label: 'Spam Submission Behavior' | t('formie'), instructions: 'When a submission is marked as spam, select what behaviour to perform for users. It’s highly recommended to act as if the submission was successful to prevent parties from learning how to get around the spam protection.' | t('formie'), name: 'spamBehaviour', value: settings.spamBehaviour, options: [ { label: 'Show success' | t('formie'), value: 'showSuccess' }, { label: 'Show error message' | t('formie'), value: 'showMessage' }, ], toggle: true, targetPrefix: 'submit-behaviour-', warning: macros.configWarning('spamBehaviour', 'formie'), }) }}
{{ forms.textareaField({ label: 'Submission Message' | t('formie'), instructions: 'This text will be shown as an error after submission.' | t('formie'), name: 'spamBehaviourMessage', value: settings.spamBehaviourMessage, warning: macros.configWarning('spamBehaviourMessage', 'formie'), }) }}
{{ forms.textareaField({ label: 'Spam Keywords' | t('formie'), instructions: 'If a submission contains any of these words (in any field), it will be marked as spam. One word or IP address per line. It will also match words within other words (e.g. ’craft’ will match ’crafty’). Case insensitive.' | t('formie'), name: 'spamKeywords', rows: 10, value: settings.spamKeywords, warning: macros.configWarning('spamKeywords', 'formie'), }) }} {% endnamespace %}
{% endblock %}