1.8

Table Of Contents
Tip
For a detailed description of how to use Mandrill to send and track emails, see the following how-
to: Using Mandrill.
Adding custom ESP handling instructions
Most ESPs allow you to provide custom handling instructions as part of the email message, via
custom headers. Typically these include instructions to enable open rate tracking, click through
rate tracking and assign tags/categories to messages. Assigning a tag/category allows you to
view statistics per email type in the dashboard of the ESP. Note that each ESP has its own
notation and instructions.
In a Connect template, adding these custom headers is handled through a Control Script (see
"Control Scripts" on page281, "Control Script API" on page559 and "section" on page564).
The following samples show how to assign a tag or category to a message (e.g. invoice’,
confirmation, newsletter-jan-2017) for various ESPs.
SendGrid
Dashboard: https://app.sendgrid.com/
Documentation: https://sendgrid.com/docs/API_Reference/SMTP_API/using_the_smtp_
api.html
Sample Control Script to assign a category:
var headerObj = {
"category": ["invoices"]
};
merge.context.sections["Content"].headers = {
"X-SMTPAPI": JSON.stringify(headerObj)
};
Note
Sendgrid strips out their mail headers. The results need to be verified via their Dashboards (e.g. the
Stats section lets you verify the stats for specific categories). Alternatively one can use their Web
Page 601