Creating a new Email Digest Template

Email templates in Metric Insights are created using HTML, CSS, and JavaScript, allowing great control over how the email body of your company's digests will look.

If your business requires a custom template, you can create one following the instructions below, or contact [email protected] to submit a request for a template with specific requirements.

1. Open the list of Email Templates

1. Open the list of Email Templates
  1. Go to Admin > Email Templates
  2. The list of email templates available in the system opens. Your Metric Insights instance comes preloaded with 16 default templates shown at the screen above. Each of such templates is marked either as locked or default and can be neither edited, nor deleted

2. Creating a new template

[Option 1] Duplicate on of the default templates

[Option 1] Duplicate on of the default templates
  1. Open the Digest Template that should serve as a basis of a new editable template
  2. Click the Duplicate icon at the top right corner of the screen
  3. Provide a name for a new template in the opened pop-up
  4. Click Duplicate

You can edit this template according to your requirements. For more details on Email Template properties and settings, refer to Step 3.

[Option 2] Create a new Template based on an existing one

[Option 2] Create a new Template based on an existing one
  1. Open the list of Email Templates
  2. A the page bottom click [+ New Template]
  1. Select the email type to which a new template should be applied
  2. Enter unique template Name
  3. This section changes dynamically depending on the Email type in the first field. Specify if the template will be the default for either Digests or Bursts

Save your entry.

3. Defining Digest Template settings in the Editor

Information tab

Information tab

Information tab allows you to set Default templates and to specify datasets for inclusion in Preview and Test emails.

The Attached Datasets section allows you to add a set of data from MI elements to be available in the email digest. In order to specify a dataset:

  1. Click  [+ New Dataset]
  2. Select a dataset you want to use
  3. Save the changes made

You can use this option to specify MI elements you want to see in your digest for the specified template. E.g. When you specify Report 1 in Dataset for a particular Digest Template and set users to receive the template emails, they will receive the Report 1 dataset in emails.

NOTE: It's not obligatory to add datasets for creating digest templates.

Email Structure

Email Structure

The Change history button allows you to view revisions to your code over time.

The screenshot above displays the default Favorites template. You can use this as a base example of the code from which to build your own template.

NOTE: If you duplicated one of the default templates, this tab is going to contain the HTML code that is used to define the structure of the email body. If you create a template from scratch, it is going to be empty.

Transformation & Rendering

Transformation & Rendering

This tab contains the rendering template for each section identified in the sections tab. This code specifies how the data will be rendered.

NOTE: If you duplicated one of the default templates, this tab is going to contain the HTML code that is used to define the structure of the email body. If you create a template from scratch, it is going to be empty.

How to remove hyperlinks from email templates?

To remove the href entirely:

$('#elementsTd').find('a').each(function(){

       $(this)

           .removeAttr('target')

           .removeAttr('href')

Section Templates

Section Templates

From this tab, you can manipulate the input data, such as appending report data (datasets) to the core digest data object (digestTemplate.data), applying transformation functions, and initiating the rendering of email sections as defined in the sections code.

NOTE: If you duplicated one of the default templates, this tab is going to contain the HTML code that is used to define the structure of the email body. If you create a template from scratch, it is going to be empty.

Settings

Settings

The variables in the Settings tab allow you to customize as well as turn on/off features for your Digest and Burst Emails.  Some examples are:

  1. SHOW_UNSUBSCRIBE_LINK will determine whether or not an unsubscribe link will be included in the emails
  2. HEADER_IMAGE can be changed to a file uploaded via the Branding page
  3. MAX_DIGEST_ANNOTATION_DISPLAY will set the maximum number of annotations displayed within the Digest

Applying custom email digest templates

Favorites Digest

Favorites Digest

In order to use your newly created custom Email Digest Template in Favorites Digest you need to:

  1. From the User menu, select "Favorites"
  2. Choose your custom Email Digest Template from the Email template drop down list

To learn more about Favorites Digests, visit: What are Favorites Digests?

Bursts

Bursts

Templates are applied to your Bursts in the same manner as favorites.

  1. From the User menu, select "Bursting"
  2. Choose your custom Email Digest Template from the Email template drop down list

To learn more about Bursts, visit: Setting up a new report burst