The SMTP API JSON string allows you to attach an unlimited number of unique arguments to your email up to 10,000 bytes. The arguments are used only for tracking. They can be retrieved through the Event API or the Email Activity page.
These arguments can be added using a JSON string like this:
1 2 3 4 5 6 7 8 9 10
These arguments can then be seen in posts from the SendGrid Event Webhook. The contents of one of these POST requests would look something like this:
Example Webhook Post Data
1 2 3 4 5 6 7 8 9 10 11 12 13 14
There are a few cases where unique_args cannot be attached to the Event. Specifically Bounces that are returned via the Return-Path. Please keep this in mind when developing unique_args POST handling.
Unique Arguments will also be shown in the Email Activity tab of your account.
To apply different unique arguments to individual emails, you may use substitution tags. An example of this would look like:
1 2 3 4 5 6 7 8 9 10 11