Templates Management for transactional emails

updated 5 months ago

In this article:

Transactional email templates let you create predefined email content for reuse, saving time and effort, especially for frequently sent emails like notifications or password recovery. Instead of drafting the email body every time, you create a template once with placeholders (variables) that are dynamically replaced when sending the email via an API call.

For example, a simple template might look like this:

Hi {{name}}, Click here to confirm your subscription: {{link}}

When sending the email, you only need to provide the values for {{name}} and {{link}}, rather than constructing the entire email body each time.

Creating a template if Engage is your Email Service Provider (ESP)

If you have connected your custom domain to Engage, this means Engage is your ESP.

Engage uses liquid as its templating engine. (Liquid is the same templating language Engage uses for personalization. Here is how to use liquid in your templates:

Basic variables

You can create a variable placement in the format {{variable_name}}. Example

Your reset code is {{code}}

You can then pass any value you want to replace code

Control flow

You can use control flows to create conditional flows in your template. Example:

{% if name %}
  Hey {{name}}
{% else %}
  Hi Stranger!
{% endif %}

Learn more about Liquid here: https://shopify.github.io/liquid/

How Engage manages your templates when you bring your Email Service Provider (ESP)

With Engage, templates are managed directly on the connected service (Mailgun or Amazon SES). When you create a template in Engage, it is automatically synced with your account on the selected service.

This means:

  • Templates you create on Engage are created on your ESP.

  • Templates you update on Engage are updated on your ESP.

  • Templates you delete on Engage are deleted on your ESP.

When creating or updating your template, remember to create them using the templating syntax or templating language supported by the ESP. For example, Mailgun and Amazon SES templates use Handlebars, so your template should be designed using that.

How to send a templated email

To send a transactional email using a template, you can use the Engage Transactional Messaging API. This works even if you are have brought your own ESP. Engage will connect to the email service to send the templated email. If you prefer, you can use the ESP's API instead as well.

Here is a link to Mailgun and Amazon SES API for templated emails.

Was this article helpful?