Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Registers a form field to be a confirmation_field. A confirmation_field is a field which value will be an email address to which a confirmation mail should be sent after the form is submitted. This will allow you to build forms which send a confirmation mail to the person who filled in the form, and not just to some fixed email address which is given as parameter for the form tag.

You have to give the content for the confirmation email. You can give this by either directly inputting the content into the tag (using the "body" argument), or by specifying a template (theme file). You should put the template in the "mails" folder in the root of your theme. 

...

Note: This tag does not replace the tag 'register_form_field', so to activate a field in the form, you still have to use the 'register_form_field' tag.

Note: This tag has a gracious error handling, meaning that if a field that is registered as confirmation_field is not given, or does not contain a valid email address, the confirmation mail will not be sent.

...

This will register the field "person_email" as a confirmation_field. When someone fills in the form, and inputs someone@getplate.com in the field person_email, then an email will be sent to someone@getplate.com with the content found in the theme file located at "/mails/default_email.plate".

Note: In this template you will have access to the 'The following Objects are accessible inside the mail template:

  • submitted_form_fields

...

  • similar to the object in that is accessible in the form tag. This allows you to render the submitted fields in the confirmation email.

  • site The same as the site objects inside the Plate templating language

  • form The element that represents the form, so the object used in the for attribute of the form tag.

An example template could look like this (assuming one of the fields is named "Name"):

Code Block
Dear {{ submitted_form_fields["Name"] }}
<br> 
Thank you very much for your message on {{ www.getplate.comsite.name }}. We will get back to you within the hour.
<br>
<br>
Kind regards
<br>
The Plate-Team

...