Skip to main content

         This documentation site is for previous versions. Visit our new documentation site for current releases.      

This content has been archived and is no longer being updated.

Links may not function; however, this content may be relevant to outdated versions of the product.

Creating email correspondence by using a template

Updated on May 3, 2020

Correspondence rules, when configured as an email, allow the use of email templates. Email templates ensure the consistent presentation of email content and give designers flexibility in styling emails. Email templates are available in the correspondence rule form by selecting Templated email from the Edit mode menu.

You can include a section or rule in email correspondence rules by clicking Insert property or Insert rule in the text editor.

Creating an email from a template

Pega® Platform includes a comprehensive set of preconfigured email templates. Email templates include a header, footer, hero banner, and column sections in which you can place your content.

To select an email template from within a correspondence rule:

  1. Create or open a correspondence rule. The correspondence rule must be of the email type.
  2. On the Corr tab, click Edit mode and click Templated email.
  3. Click Pick email template to open the template menu, and select a template.
  4. Click each section of the template to edit the content in the text editor on the right side of the form. The preview on the left side of the form is updated while you type.

You can also add your own template by clicking the Load template from file to open the file browser. Using the file browser, select and upload an HTML file of the email template that you want to use.

Creating an email template from HTML

You can create an email template from an HTML email by adding the data-pega-region attribute to the elements that you want to expose in the correspondence rule. In the correspondence rule, regions with this attribute can be edited. For example, by adding the attribute data-pega-region=”Header text” to a template, when imported as an email template, that region becomes available for editing when clicked. Any element can be defined with the region attribute. As a best practice, define the regions that hold text or images such as, td, p, li, div, etc.

The data-pega-region code in HTMLThe data-pega-region code in HTML

To mark up an email template:

  1. Open the email template in a text editor or use the HTML tab in the section rule for a section marked as an email template
  2. Add the data-pega-region attribute with the region name inside the tags of the desired regions. Give each region a unique region name.
  3. Save the text file or section

Once the email template is created, in the correspondence rule you can use by either selecting from the template picker modal or load from the file system depending on the action selected.

Switching edit mode

The email correspondence rule has three edit modes: simple rich text editor, source only, and templated email. You can switch between these modes by using the Edit mode menu. When you switch to the templated email edit mode from one of the other modes, content will be reapplied.

Preview your email

You can preview the email's appearance in two form factors. Click Desktop or Mobile to view how the email will be displayed in each form factor.

Using sections as email templates

You can configure sections as email templates on the Settings tab of the section. When configured as an email template, the section is available as a section in the email correspondence rule.

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best. is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us