Setup Behavioral Emails

Creating an Email Template

Before you can create a new email template, a saved behavioral cohort must already be created. Refer to the documentation for Saved Cohorts.

Select the Create New + button on the left-side navigation menu and select Behavioral Email.

Alternatively, select Behavioral Emails from the left-side navigation menu. Both will bring you to the Behavioral Emails section.

Create New button behavioral email

Within the Behavioral Emails section, click + Create Template on the top right.

Pick Email Template

Choose to start from a blank canvas or select a predefined template.

Pick Email Template

Defining Email Template Criteria

Once the editor opens, there are a variety of fields you can populate to create an email template.

Creating Email Templates

Send To

You can send your email to any saved user cohort. A saved user cohort is a dynamic group of users defined based on their behavior such as “Users who made over 100 API calls in last 5 days from Node.js” and can be created within the users analytics panel.

Subject Line

A short and concise subject line that describe the contents of the email.

From Address and From Name

The from address is the address which will be used to send the email such as Keep in mind your domain should be configured correctly for DKIM and SPF in your email provider for the best deliverability. The from name can also be specified.

CC and BCC

You can also add a CC or BCC. Many CRMs provide a BCC address so you can log any customer communication right in your CRM.

Recurring Workflow

Normally, a user can only receive the same email once. However, you can make the template recurring. Users who still meet your cohort criteria can be re-enrolled into this email workflow. Recurring workflows are useful for things like exceeded quota warnings, monthly billing reminders, etc.

If you set the workflow as recurring, you must define the time period that must pass before a user will be eligible for re-enrollment. Keep in mind the user must still be a member of your cohort after the time has passed.

For example, if you want to create a workflow that sends warning emails to any customer who exceeded their subscription up to two times per billing month, you could define the re-enrollment period 15 days.

Using the Email Editor

The email editor allows you to build beautiful, responsive emails using drag and drop content modules. The templates have been extensively tested with Litmus and Email On Acid to ensure rendering in a variety of email clients.

Content Modules

Content Modules provide a multitude of options to design your email template. These options include:

  • Columns
    • Add columns to your design in order to have a better design arrangement
  • Button
    • Buttons of any type can be added and customized to have their colors and styles match your design
  • Divider
    • Provides spacing between components
  • Heading
    • Add headings (from level 1-6)
  • HTML:
    • Add custom HTML to customize your design beyond the tools provided
  • Image
    • Designate an image to be placed within the template
  • Menu
    • Used to create navigation menus
  • Text
    • Add text with a full suite of styling options

Layout Blocks

Layout Blocks can help provide a structure for you email template. They are containers that can hold content modules and make designing a layout easier for things like defining multiple columns.


General configuration options for your email templates like defining the link color, text alignment, and content width.


A wealth of images that can be dropped into your template. Powered by Unsplash, Pexels and Pixabay, all images are provided and licensed under Creative Commons Zero. This means you are free to use these images in your email template.

Using Merge Tags

Merge tags allow you to personalize the email for each user. Merge tags can be inserted into a block of text by selecting on the Merge Tags button in the text editor toolbar. Any analytics field, including custom metadata, can be inserted into the email such as the name of the user or their plan.

Merge Tags Selection in Email Editor

Adding Custom Metrics via Merge Tags

Merge tags also give the capability to add aggregated event metrics into the email body. These custom metrics can help with sending emails that have tailored quota and usage content.

Depending on the data type within the field (string, number, or data), certain operations/aggregations will be available. The operations available include:

Operation Result Applicable Data Type(s)
Top Terms returns an array of the top terms within the aggregated events string
Min returns the min value from the aggregated events number, date
Max returns the max value from the aggregated events number, date
Average returns the average value from the aggregated events number, date
Sum returns the sum of the value from the aggregated events number, date


Custom metric tags also have the following limitations to be aware of:

  1. The target cohort must have behavioral criteria in the cohorts filter (within the Who Performed section). (aka, and Performed somethign part).
  2. The email can have only one target cohort as the email’s destination.
  3. Only 5 custom metrics can be defined. If it is defined but not used in the email portion as a merge tag, that particular metric won’t be saved.
  4. custom metrics do not support aggregating request or response body fields.

Creating a Custom Metric Merge Tag

To add the custom metrics within an email, you will need to define what the custom metric is. Once defined, it can be referenced within the email body. This can be done by clicking on the Define Custom Metric Merge Tags button at the top of the email editor.

Custom Merge Tags Button in Email Editor

In the modal that appears, you can then select the Field that the custom metric will use and the Operation that should apply to it.

Set Custom Merge Tag Criteria

Once you’ve populated the screen with the custom merge tags you want, you will then click Set Merge Tags in the bottom-right of the modal.

Now, in the email editor, you can select your custom merge tags by going into the text editor, clicking in a text area, and selecting the custom merge tag from the Merge Tags dropdown selector.

Selecting Custom Merge Tags in Email Editor

Editing Existing Emails

To edit existing email templates, locate the item you’d like to edit in the email list and click on the Template Name.

Edit an email in a list of created email templates

Once the email is loaded, editing can be done with the same steps outlined in above in Defining Email Template Criteria docs.

Cloning an Email

If you’d like to duplicate an email, can create a copy of an existing email. To do this, find the email you would like to copy, click the vertical ellipsis button at the end of the entry and select Clone.

Cloning an email

The email will be duplicated and a copy will appear in the list of available emails. The email template will be disabled by default.

Copy an email

Sending a Test Email

If you’d like to test an email ensure proper formatting or other reasons, you can manually trigger a test email to be sent. To do this, find the email you would like to test, click the vertical ellipsis button at the end of the entry and select Test.

Testing an email

A modal will appear to confirm the email you’d like to send the test email to. Once an email is supplied, click Send to send the test email to the desired recipient.

Send test email modal

Deleting an Email

If an email is no longer required and simply disabling it is not the desired approach, you can delete an email template. To do this, find the email you would like to delete, click the vertical ellipsis button at the end of the entry and select Delete.

Delete email template

A modal will appear to confirm the deletion. Click Delete to permanently delete the email.

Confirm deletion modal

Enabling and Disabling Emails

To enable or disable an email, toggle the Is Active button to your desired selection.

Toggling email is active status

Alternatives to Using Behavioral Emails

Alternatively, instead of designing emails in Moesif, you can also connect to an existing marketing tool like HubSpot or Pendo. This enables you to sync any data in Moesif users or companies to their respective entity in the CRM or marketing tool. Keep in mind, because most marketing tools cannot handle event data, Moesif provides a way to save cohorts of users based on their behavior such as “Made over 100 API calls in the last 5 days”. This is also synced to the marketing tool for easier targeting.

Embedded dashboards is another feature you can leverage to guide your customers. This enables you to embed API logs, SLA metrics, and other charts in your customer-facing portal. The data is powered by your Moesif account which means you’re able to save on cloud compute along with development time.

From Moesif