The Forms application allows you to send two types of emails automatically when a new record is added:
- Notification email – emails notifying the person responsible for form data management (content editor, administrator, etc.) about new submitted records.
- Autoresponder – email to the person who submitted the new record, typically confirming that the record has been received and will be processed.
When a user submits the form on the live site, the emails are sent according to configuration made on the Email notification and Autoresponder tabs of the form's editing interface. When you add a form record via the administration interface, you can decide whether to send the emails (as described in Managing form data).
You can configure the notification emails on the Email notification tab of a form's editing interface:
- Open the Forms application.
- Edit ( ) a form.
- Switch to the Email notification tab.
- Select the Send form data to email option if you wish to include the submitted form data within the notification email.
- Define the settings:
- Sender email – the email address from which the notifications are sent (e.g. a general sender address with your website's email domain, such as firstname.lastname@example.org).
- Recipient emails – email addresses where notification emails are sent. You can specify multiple addresses separated by semicolons. For example, add the addresses of staff members who are responsible for processing of submitted form records.
- Subject – subject of the notification emails.
- Attach uploaded documents – enable this option if you want to attach files submitted via the form (if there are any) to the notification emails.
- Use custom layout:
- If disabled, the body of the notification emails contains all field names with the entered values, each on a single line.
- If enabled, you can define a custom layout for the notifications in the text area displayed below the check box. To add the labels or values of the form's fields into the notification layout, select a field in the Available fields list box and click the Insert label or Insert value buttons. You can start by clicking Generate table layout, which adds all of the form's fields organized in a basic HTML table layout.
- Security: Visitors can potentially submit form values containing malicious HTML values. When using a custom layout, form notification emails do not encode field values by default. This can lead to potential HTML injection if the recipient’s email client is configured to display HTML content. If you wish to encode the values of submitted form fields in notification emails, add the CMSBizFormMailEncodeFields configuration key to your project’s appsettings.json or web.config file and set its value to true. Add the key to both your live site and administration projects.
You can also add macros into the form notification settings or layout to insert dynamic values. See Using macros with forms for details.
You can only use basic macros, such as the form's data fields or localization expressions. Macros that retrieve values from various types of contexts may not resolve correctly when the form is submitted on the live site.
- Click Save.