Renders an HTML form that sends out an email to the passed email address, and saves the message to the database, so the user can find it under ‘Messages’ in the site dashboard. Inside the 'form' tag, the 'submitted_form_fields' object will be available.
Arguments
The form tag accepts the following arguments:
...
to
The email address where the message is sent. (Required: if no register_form_confirmation 'to' is specified)
This can be:
...
output_as
Only accepts 'json' as value. Returns a JSON hash that can be used as a payload when POSTing to the form_messages
endpoint as a JSON request. See https://plate.atlassian.net/wiki/spaces/DOCS/pages/20578657/form#JSON-endpoint for more info on how the request works.
Advanced inputs
The following inputs should only be used with proper understanding of the implications on security:
enable_cdn
If this input is enabled, (set to true
), then Plate gets configured to not perform CSRF protection based on a timed secret. This should be used whenever a CDN or cached forms are used. Note: You must enable recaptcha for this form when enable_cdn
is set to true
.
Examples
Input:
Code Block |
---|
{% form for: form, to: form.email, success_url: form.success_page_link, enable_recaptcha: true %} {% for field in form.field_lines %} {% include field %} {% endfor %} <div> <input type="submit" > </div> {% endform %} |
...