2022.1

Table Of Contents
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, these custom headers can be added via the Email section properties
(see "Meta information" on page568).
Alternatively custom headers may be added through a Control Script (see "Control Scripts" on
page954, "Control Script API" on page1466 and "section" on page1515).
The following samples show how to assign a tag or category to a message for various ESPs.
SendGrid
Dashboard: https://app.sendgrid.com/
Documentation: https://sendgrid.com/docs/API_Reference/SMTP_API/using_the_smtp_
api.html. (Use the SMTP API; the Connect Server sends SMTP email).
Add a name meta tag with the value X-SMTPAPI and set its content to the required JSON string
(for example: "' category': ['invoices']").
You can make this setting in the Email section properties (see "Meta information" on
page568).
Alternatively you could write a Control Script, for example:
var headerObj = {
"category": ["invoices"]
};
merge.context.sections["Content"].addHeader("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 API to retrieve stats in JSON format. To view the
category stats, log in to Sendgrid and choose: Stats > Category Stats > your category
name.
Page 1567