Navigate to /contact/crud/contact-template to create a new form template., (*1)
property
required
description
Name
yes
a unique name, e.g. 'reservation'
From Email
yes
valid email used as 'From:' header
To Email
yes
one or more valid email addresses (comma separated) used as 'To:' header
Reply To Email
no
optional, valid email. Use this if you want to set 'Reply-To:' header to a fixed address for ALL mails. If set 'Reply to Schema Property' will be irgnored!
Reply to Schema Property
no
can be used to define which property from schema should be used (if valid mail!) as 'Reply-To:' header. If 'Reply To Email' is set to a fixed address, this will be ignored
Return Path
no
if set and is a valid email, this will be used as 'Return-Path:' header where bounce Mails will be send to. Handle with care
Captcha
no
this tells the contact module that a captcha will be used and that it has to validated against it (sets model scenario to captcha). Captcha widget is required in twig!
Form Schema
yes
json-schema used to build a form with dmstr/jsoneditor/JsonEditorWidget (For more information about schema see examples on: https://github.com/json-editor/json-editor)
Upgrade hints:
If the form was build with version <= 1.0.0 there was the convention, that property reply_to in your schema was used as 'Reply-To:' header in message.
this "magick" is removed! You must now set 'Reply to Schema Property' to 'reply_to' to get the same behavior!
Twig templates (Views)
Each form needs 2 Twig templates. Navigate to /prototype/twig/index to create them:, (*2)
contact:FORM_NAME: template in which the form will be rendered
contact:FORM_NAME:send: will be rendered as "thank you page" after message has been send
While FORM_NAME must be replaced with your template name, (*3)
The form can be seen at /contact/default/?schema=FORM_NAME
The "thank you page" can be seen at /contact/default/done?schema=FORM_NAME
The background and foreground colors of the captcha can be defined in the settings module under the captcha section.
It uses a particular format for colors but the last 6 characters follow the css hex color code(eg 0xff0000 is red and 0x00ff00 is green)
"Thank you page" Twig layout
<div class="alert alert-success">{{ t('twig-widget', 'Thank you for your message') }}</div>