Public previewThis feature is in Public preview and should be considered a beta feature. It may be subject to service disruption and short notice changes or improvements.
The Marketing email API provides the ability to send marketing emails without the complexities of having to create a campaign, an audience, and then schedule it to send. It's ideal for allowing your platforms and systems to send marketing emails on demand, with ease.
For the email content, you can either provide your own custom HTML, or you can include a triggered campaign ID to send a campaign you've already designed in Dotdigital. When using campaign templates for the emails content we support the full range of Easy Editor blocks, such as:
- Liquid, such as decision and loops
- Dynamic content
- External dynamic content
- Product recommendations
- View in browser link
- Double opt-in link
- Sharing
- RSS feed block
- Social bookmarks
- Etc...
Templates coupled with personalization data are a powerful and versatile way to create your email content.
Marketing opt-in checks and contacts
Email marketing status is checkedThe Marketing email API automatically checks that the email address being sent to is opted in to marketing communications. If an opt-out exists then the email is not sent.
Contacts are created for unknown email addresses
If the email address that you're targeting doesn't already exist in Dotdigital, then a new contact is created and it is assumed to be subscribed to marketing emails.
You must ensure you have email marketing consent for sendsIf we don't recognize the email address sent to, we create a contact and set the email channel to
subscribed. It's important therefore that you only attempt to send to email addresses that have consented to receive email marketing.
Allow recipients to unsubscribe
List-unsubscribeWe include the List-unsubscribe tag in the technical header of all marketing emails sent through this endpoint; you don't need to add it.
In both campaign templates and raw HTML used for sending marketing email, you must include a clear and obvious way to unsubscribe from future marketing email by including Dotdigital's unsubscribe link.
You can add the Dotdigital unsubscribe link to your HTML using the $UNSUB$ token. This is replaced with the full URL to the correct Dotdigital unsubscribe page when the email is sent.
This link is automatically included when you send using a triggered campaign ID, as you can't save a triggered campaign in Dotdigital without including this link.
In raw HTML content, you must include the token $UNSUB$ in your HTML and we replace this with a contact-specific URL to unsubscribe them from future marketing email.
The
$UNSUB$value does not include the protocolHTTP://orHTTPS://so that you're able to control this. If unsure, use//:as the protocol and this follows the protocol used by the parent document.
Example usage of $UNSUB$:
<a href="//:$UNSUB$">Click here to <b>unsubscribe</b></a>If you don't include the
$UNSUBlink in your email, the send is rejected.
Other ways contacts are unsubscribed
Dotdigital also unsubscribes a contact from email marketing if:
- they unsubscribe through a preference centre .
- we're notified by an ISP of an unsubscribe using the List-Unsubscribe header.
For example, contacts using Gmail's subscription management function to unsubscribe. - we receive an ISP complaint related to the email sent to a contact.
- the email has hard bounced, or soft bounced a given number of times, and is considered a bad email address.
Learn more about automatic suppressions for bounced email addresses. - The contact is on our global suppression list due to being a known problematic email address.
"From" emails
To control who the email is sent from you can optionally specify a from value. It works as follows:
No "from" value
If you do not specify the from value then we will automatically use the default from email addresses form:
-
Your account
If sending raw HTML rather than using a triggered campaign template then your accounts default sending email address will be used.
-
Your campaign template
If using a triggered campaign for your emails, then the campaign templates from address will be used.
Specified "from" value
You must pass a known registered Custom From Address email, if specifying a "from" value. This provides Dotdigital everything it needs to send your email, like friendly from name, IPs, etc... just like when you send in app.
Personalization fields
When using a triggered email template to provide the content of the email you can optionally provide overrides to any existing contact data fields in the personalizationFields array. The overrides will be used to populate any personalization fields in the template just for that email and will not be retained on the contact.
This can be used to provide value for contact data fields for use in the email that may not have been synced to Dotdigital yet.
Tracking email status
You can track activity related to your Marketing email API sends using either Data Firehose or the Events API.
Coming soon
Message events in the Events API are not yet available, but we are working to make them available soon.
Events raised by the Marketing email API:
| Event | Events API event raised | Firehose event raised | Applies to |
|---|---|---|---|
| Email is sent successfully | message.sent | Email send |
|
| Email delivered | message.status |
| |
| Email read/opened | message.status | Email open |
|
| Email soft bounced | message.status | Email failed |
|
| Email hard bounced | message.status | Email failed |
|
| Email failed for reasons other than a bounce For example, email address is opted-out of marketing. | message.status | Email failed |
|
| Link clicked in email | interaction.click | Email click |
|
| Unsubscribe triggered by email | interaction.unsubscribe | Email unsubscribed |
|
| Unsubscribed by list subscription notification from ISP | interaction.unsubscribe | Email unsubscribed |
|
| ISP Complaint received | interaction.unsubscribe | Email ISP complaint |
|
| Inbound | message.received | Email reply |
|
