Transactional emails are automated, API-triggered emails that are sent to individual contacts based on a specific action they have taken.

Examples include confirmation emails, password reset emails, and purchase confirmations.

Unlike campaigns or loops, transactional emails are not promotional in nature and as a result they do not require unsubscribe information to be included in the email.

To send transactional email, you need to use our API.

How it works

Sending transactional email with Loops has two steps.

First, you need to create a transactional email within Loops using our handy email editor. In your email you add data variables, which let you insert custom data into each email you send.

The second step is to use the Loops API to send the transactional emails to your users. All it takes is a simple call to our transactional endpoint. Your request needs to include the ID of the transactional email you created, the receipient’s email address and the data variables needed for the email.

Read on for more details about creating, editing and sending transactional emails.

Compose your email

There are two ways to create emails in Loops: using our editor or import an MJML template.

Use our builder

You can build emails in the editor, including adding data variables.

In this example email, a user clicks the Reset Password button to reset their information.

We have two data variables: name and resetUrl.

You can insert data variables into the text of the email with the “Insert data variable” button:

You can also add data variables as links (on text, images and buttons). This is how we add resetUrl as the button’s link in our example:

Bring your own MJML

You can also upload your own MJML code to use in the email. This is useful if you have a pre-existing template you want to use.

For a general overview of uploading custom emails with Loops, see here.

At this time, you cannot use merge tags in MJML transactional emails. However, we do support using data variables. For example, if you have a data variable called PasswordResetLink, you can use it in your MJML like this:

<mj-text>{DATA_VARIABLE:PasswordResetLink}</mj-text>

Note the uppercase “DATA_VARIABLE” and the colon before the variable name.

Important information about data variables

  • Make sure that when you send a transactional email that you include the required data variables (as you defined in the editor).
  • If you do not include the correct set of data variables in your API call, the send will fail.
  • We do not currently offer optional or conditional data variables. Using an empty string "" will also cause the email to fail.
  • Data variables are case-sensitive and can only contain letters, numbers, underscores, and dashes.
  • Data variable values sent over the API can be string or number.

Review your email

On the next page, after clicking “Next”, you’ll see the API Details section. This contains the data variables used in the email as well as a sample payload for reference. The “Transactional ID” lets you distinguish between different transactional emails when calling the API and is required.

Publish the email

To enable sending the email, it needs to be published by pressing “Publish”.

Send your email

In the example above, two Data Variables were used in the email and there is a transactional ID needed as part of our API call. Any data variables created in the email are required when making the API request.

Here’s an example of the request for sending this email:

Send a POST to this endpoint (make sure to authenticate)

https://app.loops.so/api/v1/transactional

Payload

You can copy an email’s example payload from its Publish page in Loops by clicking the “Show payload” button.

{
  "transactionalId": "clfq6dinn000yl70fgwwyp82l",
  "email": "[email protected]",
  "dataVariables": {
    "name": "Chris",
    "passwordResetLink": "https://example.com/reset-password"
  }
}

Find more details about sending transactional emails with the API in the API docs.

Editing the email

To edit the email, press “Edit as Draft” on the Compose page:

The previous version of the email will continue sending until you republish the email. This means you can edit transactional emails while still sending your existing emails.

While editing, you can switch between your draft and the published version with the dropdown on the Compose page:

To publish your changes, click “Next” to go to the Publish page, then click “Republish”.

Metrics

After emails are sent, details are shown in the email’s Metrics page.

These include send time and if messages experienced any issues with delivery (bounces or spam complaints).

Note that open and click tracking is disabled for transactional messages to improve deliverability for infrastructure-level communications.

Was this page helpful?