Manage templates for system emails
Multiple Sitefinity CMS components can be configured to send email notifications to subscribed users, thus enabling you to inform members of your team about actions that require their attention. Such actions can be pending approval of a content item waiting for their review or a new form submission that must be checked. The emails that Sitefinity CMS sends out automatically to backend users are called system emails.
Each system email is sent out via the Notification Service, and its content is based on a predefined email template. Sitefinity CMS enables you to manage the system email templates from a central place in the Basic Settings menu. You can edit a template, specify whether it’s valid for all sites or for selected sites only, or restore a previously edited template to its default state.
To edit a system email template, follow these steps:
- Navigate to Administration -> Settings
- Select System emails
- The screen lists the system email templates available for editing.
- By default, if you are using Sitefinity CMS in Multisite mode, all system email templates are shared among all sites. If you want to make changes to the system email templates that will be valid for one site only, select the desired site from the All sites dropdown. The dropdown is located next to the System emails label. If you want your changes to be applied to all sites, leave the All sites option selected and proceed with the steps below
- Click on the template you want to edit
- The email template editor screen opens
Work with the email template editor
Via the template editor you can modify the email subject and body. You can use rich text via the familiar Sitefinity CMS WYSIWYG editor.
Insert dynamic data in your system email templates
In addition to rich text, you can also insert dynamic data in your emails subject and body. Dynamic data represents specific fields whose values are resolved when Sitefinity CMS processes the email and sends it out. For example, you can edit the email template, used for sending notification email when a new from entry is submitted. You can insert the form Title field as dynamic data in your template. This way, when a notification email is sent, Sitefinity will replace the dynamic data placeholder in the email with the actual title of the form, and the notified users will know for which form the new entry has been submitted.
Dynamic data fields and their syntax are specific for each module. When you are editing a system email you can select all the available dynamic data fields for the template via the Insert dynamic data dropdown, located on the right of the rich text editor. To insert dynamic data, follow these steps:
- In the email template editor select the place in your email subject or body text, where you want to insert the dynamic data.
- Using the Insert dynamic data dropdown, select the desired dynamic data field
- Click on the Insert button below the dropdown
As a result, the dynamic data field will be inserted in your template with its specific syntax. For example, when you insert the form title, the syntax is {|Forms.Title|}. This is intentional, so you can distinguish the dynamic data in your template, When the email is sent, Sitefinity parses the template and replaces the syntax with the actual value of the field.
Configure sender name and email address
Depending on your use case scenario, you might need to have a different sender email address and name for different system email templates. The email template editor enables you to specify a Sender name and Sender email address on a template level.
When you fill in these text boxes, Sitefinity CMS uses their values to set the From field information, when sending out emails based on this template. If you leave the textboxes blank, Sitefinity CMS uses the Default sender email address and Default sender name values from the Email settings configuration for the system. For more information see Configure email settings.
Restore template to original
When you modify a system email template and save it, Sitefinity CMS starts using the new version of the template you created. The original version of the template, that Sitefinity CMS ships with is always available if you want to restore the template to its default state. To do that, follow these steps:
- In the email template editor click on the Restore to original button
- The template subject and body will be reset with their original text
- Click on Save changes to persist the restored template or click Cancel to reject the restore to default and keep your previous template version
Send test email with your email template
When working with the email template editor you can send a test email and observe what your changes look like when the subscribers receive the system email. You can send a test email anytime as you’re making changes to the template, without having to save your changes first. This way you can use the functionality to preview your changes and save them one you are satisfied with the result. To send a test email:
- In the email template editor click on the Send test email button
- In the dialog that opens, provide the email address you want to send a test email
- Click on the Send test button
NOTE: When sending a test email, for demonstrative purposes the dynamic data fields you have inserted will be resolved with their friendly names as they appear in the Insert dynamic data dropdown.