Form notification emails

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).

Notification emails

You can configure the notification emails on the Email notification tab of a form’s editing interface:

  1. Open the Forms application.
  2. Edit () a form.
  3. Switch to the Email notification tab.
  4. Select the Send form data to email option if you wish to include the submitted form data within the notification email.
  5. 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 form-notifier@company.com).
    • 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. See Custom email layout.
  6. Click Save.

Custom email layout

When using a custom notification email layout, you can add the labels or values of the form’s fields:

  1. Select a field in the Available fields list box.

  2. Click Insert label or Insert value.

    • For fields based on selector form components (e.g., Drop-down list or Radio buttons), use Form data macros to insert the value of the field. For example: {%DropDownField%}

To create a starting point for the layout, click Generate table layout, which adds all of the form’s fields organized in a basic HTML table.

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.

Macros in form emails

You can also insert dynamic values into the form notification settings or layout by adding macros. See Using macros with forms for details.

Only basic macros are supported, 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.