{
  1. Intro
  2. From domains
    1. Get all from domains
    2. Get specific from domain
    3. Create from domain
    4. Verify from domain
    5. Delete from domain
    6. From domain object definition
  3. From addresses
    1. Get all from addresses
    2. Get specific from address
    3. Create from address
    4. Update from address
    5. Delete from address
    6. From address object definitions
  4. Address lists
  5. Templates
    1. Get all templates
    2. Get specific template
    3. Create template
    4. Update template
    5. Delete template
    6. Template object definitions
  6. Campaigns
    1. Get all campaigns
    2. Get specific campaign
    3. Create campaign
    4. Update campaign
    5. Delete campaign
    6. Clone campaign
    7. Get statistics
    8. Get clicks
    9. Get statistics details
    10. How to use triggered campaigns
    11. Campaign object definitions
  7. Mailings
    1. Get all mailings
    2. Get specific mailing
    3. Create mailing
    4. Update mailing
    5. Delete mailing
    6. Get statistics
    7. How to use merge fields
    8. Mailing object definitions
  8. Mails
    1. Create mail
    2. Create triggered mail
    3. Get statistics details
    4. Mail object definitions
  9. Unsubscriptions
    1. Get all unsubscriptions
    2. Create unsubscription
    3. Delete unsubscription
    4. Unsubscription object definition
  10. Webhooks
    1. Get webhook
    2. Create or update webhook
    3. Delete webhook
    4. Webhook object definition
    5. How to implement the webhook

How to use merge fields

Merge fields can be used to personalise a mailing by including address data in the mail, for example a name. This page describes how you can use merge fields, shortened links and system links in your mailings.

Use custom merge fields

You can have up to 10 custom mergefields. In this example we'll show you how to use a "Name" and "City" merge field.

  1. Create a new address list with Name as MergeFieldHeading1 and City as MergeFieldHeading2.
    { "Name": "Demo", "MergeFieldHeading1": "Name", "MergeFieldHeading2": "City", }

  2. Add addresses to the address list with the name of recipient in MergeFieldValue1 and the city in MergeFieldValue2. If you define something as MergeFieldHeading8 on the address list, the data for that field should go in MergeFieldValue8 on the address.
    { "EmailAddress": "john.doe@cm.com", "MergeFieldValue1": "John Doe", "MergeFieldValue2": "Breda" }

  3. Use the merge field tag in the htmlbody or textbody of the template, or in the subject of the mailing. Examples of the tags in this case.
    Merge field name Tag used
    Name {{ Recipient.Name }}
    City {{ Recipient.City }}


  4. Add the mergefield as a mergetag object to the mergetags collection of the mergefields object of the template. The mergefield object consists of a Name, Value and a mapping. The Name should be the name of the mergefield, the Value should be the tag used in your template or subject, and the mapping should be the mapping to the field in the address.
    { "Name": "Recipient.Name", "Value": "{{ Recipient.Name }}", "Mapping": "Recipient.MergeFieldValue1" }, { "Name": "Recipient.City", "Value": "{{ Recipient.City }}", "Mapping": "Recipient.MergeFieldValue2" }

Default merge tags

The following default mergetags can be used in your mail.

Description Placeholder in body Merge tag object
Sender email address {{ Sender.EmailAddress }} { "Name": "Sender.EmailAddress", "Value": "{{ Sender.EmailAddress }}", "Mapping": "Sender.EmailAddress" }
Recipient email address {{ Recipient.EmailAddress }} { "Name": "Recipient.EmailAddress", "Value": "{{ Recipient.EmailAddress }}", "Mapping": "Recipient.EmailAddress" }

Use shortened links

You need to create links as special link in the mergefields object in order to be able to see the number of clicks of your link later on. Links provided as special link will automatically be shortened. In this example we will use https://www.cm.com as the url that we want to trak in our mailing.

  1. Create a tag to use in the htmlbody or textbody of the template, or in the subject of the mailing. For example: [[ SpecialLink.link1 ]]
  2. Add the link to the speciallinks collection of the mergefields object of the template. The special link consists of a Type, Label, Link and Mapping. The Type should be link, the Label you want to give this link, the Link should be the tag used in your template or subject and the Mapping should be the real url.
    { "Type": "link", "Label": "CM", "Link": "[[ SpecialLink.link1 ]]", "Mapping": "https://www.cm.com" }

System links

We have some default system links that you can use in your mailings.

Description Placeholder in body Special link object
Unsubscribe link, this will allow users to unsubscribe for your mailings.
They won't get mails when you try to send to them again.
[[ SpecialLink.Unsubscribe ]] { "Type": "system", "Label": "Unsubscribe", "Link": "[[ SpecialLink.Unsubscribe ]]", "Mapping": "SpecialLink.Unsubscribe" }
View in browser, this will allow users to view your mailing in the browser. [[ SpecialLink.ViewInBrowser ]] { "Type": "system", "Label": "View in browser", "Link": "[[ SpecialLink.ViewInBrowser ]]", "Mapping": "SpecialLink.ViewInBrowser" }
Pixel, this will allow you to track if a user has opened your mail.
This one should only be included in the html body and not in the text body.
[[ SpecialLink.Pixel ]] { "Type": "system", "Label": "Viewed", "Link": "[[ SpecialLink.Pixel ]]", "Mapping": "SpecialLink.Pixel" }

Complete example merge tags and special links

Address list:

{ "Name": "Demo", "MergeFieldHeading1": "Name", "MergeFieldHeading2": "City", }

Address:

{ "EmailAddress": "john.doe@cm.com", "MergeFieldValue1": "John Doe", "MergeFieldValue2": "Breda" }

Mailing template textbody:

Hello {{ Recipient.Name }}
According to our data your email address is {{ Recipient.EmailAddress }} and you live in {{ Recipient.City }}.
You can see our new and improved website on [[ SpecialLink.link1 ]]
Kind regards, Team CM
If you don't want to receive our mails anymore you can unsubscribe here: [[ SpecialLink.Unsubscribe ]] If your mail isn't looking correctly, you can view it in the browser here: [[ SpecialLink.ViewInBrowser ]]

Mailing template mergefields:

{ "MergeTags": [ { "Name": "Recipient.Name", "Value": "{{ Recipient.Name }}", "Mapping": "Recipient.MergeFieldValue1" }, { "Name": "Recipient.City", "Value": "{{ Recipient.City }}", "Mapping": "Recipient.MergeFieldValue2" }, { "Name": "Recipient.EmailAddress", "Value": "{{ Recipient.EmailAddress }}", "Mapping": "Recipient.EmailAddress" } ], "SpecialLinks": [ { "Type": "system", "Label": "Unsubscribe", "Link": "[[ SpecialLink.Unsubscribe ]]", "Mapping": "SpecialLink.Unsubscribe" }, { "Type": "system", "Label": "View in browser", "Link": "[[ SpecialLink.ViewInBrowser ]]", "Mapping": "SpecialLink.ViewInBrowser" }, { "Type": "link", "Label": "CM", "Link": "[[ SpecialLink.link1 ]]", "Mapping": "https://www.cm.com" } ] }