Send transactional email using a triggered campaign

Sends a transactional email using a triggered campaign

This operation sends a transactional email using a triggered campaign as its content.

🚧

Do not use transactional emails for marketing purposes

Using a transactional email to send marketing content is a compliance violation because unsubscribe links are automatically removed from transactional email campaigns. To protect your sender reputation, only use transactional emails for transactional purposes:

  • Account balances
  • Password reminders and resets
  • Order confirmations
  • Shipping notifications

To send triggered marketing email campaigns with our API, check out the Send campaign API call.

If you're sending to multiple recipients:

  • You must separate email addresses with a comma.
  • You are sending one email to multiple recipients, and all contact email addresses appear in the To box. We therefore recommend using BCCAddresses to protect each contact's email address.
  • CCAddresses is usually used with ToAddresses.

This operation doesn't add to your allotted total calls per hour.

🚧

Send to an individual per email for granular tracking

To ensure we can accurately send you webhook events such as sent, delivered, read and clicked, only add a single recipient per email.

You can use our batch transactional email API methods to send large collections of emails efficiently.

You can receive interaction.click webhook events whenever any of your tracked links are clicked on by customers allowing you to trigger follow ups or track interactions within your own systems.

There is no string length limit for the Name and Value values.

When sending a transactional email through this endpoint, you're not required to provide the subject line or from address. This is because the operation uses the subject line and from address of the triggered campaign as set up in Dotdigital.


Pass JSON objects as personalization values

PersonalizationValues.Value can be string or JSON. All personalizationValues are also available in the liquid object collection.

You can send complex personalization data—such as objects and arrays—inside your API request. This is especially useful when you want to use structured data, such as order data, for advanced template logic.

Example

{
  "personalizationValues": [
    {
      "name": "First",
      "value": "Mark"
    },
    {
      "name": "order",
      "value": {
        "order_number": "123456",
        "items": [
          { "title": "itemA", "price": 1.00 },
          { "title": "itemB", "price": 2.00 },
          { "title": "itemC", "price": 3.00 }
        ]
      }
    }
  ],
  "toAddresses": [
    "[email protected]"
  ],
  "campaignId": 826775
}

Use JSON object personalization in Dotdigital email templates

If you send a JSON object in your transactional API personalization values, you can access and loop through this data in your Dotdigital email templates using Liquid.

To do this:

  1. In Dotdigital EasyEditor, edit your email campaign template and drag a text box to the area of the email body where you want the content to appear.

  2. With the text box selected, in the EasyEditor toolbar, select the Edit HTML icon.

  3. Enter the Liquid markup to loop and display the data.

For example, to list items and their prices from an order:

{% for item in data.order.items %}
  {{ item.title }} costs {{ item.price }}
{% endfor %}

This outputs each item’s name and price.

Example output

itemA costs 1.00 itemB costs 2.00 itemC costs 3.00

You can access any property from your JSON object with:

  • Single value Order number: {{ data.order.order_number }}
  • Looping through an array
    As in the example above.

Unsupported content

You receive the response ERROR_CAMPAIGN_CONTAINS_UNSUPPORTED_BLOCKS if your triggered campaign contains any unsupported EasyEditor building blocks and links.

🚧

A note on HTML compatibility for personalisation content

When using transactional email personalisation, the type of personalised content needs to be compatible with the HTML element it's being put into within the triggered campaign. For example, if the operation contains a personalised table, it will need to go into a table element in the campaign, not a paragraph.

Check with your campaign designers to ensure that their campaign's elements are suitable for the personalisation content being used.

A successful request returns a 200 OK with no content in the response.

Language
Credentials
Basic
base64
:
URL
Click Try It! to start a request and see the response here!