How to Tag and Track Outbound Messages with User Defined IDs

Message IDs and Mailing/Campaign IDs can be specified in an outbound message's header. These identifiers remain with messages throughout their lifetime and are reported in the logs and plugin API events to help you match events with source data.

The following headers are supported:

  • X-xsMessageId Specifies a custom outbound Message ID that will be used in logs and API events. Valid characters include 0-9, A-Z, a-z, and hyphen.

  • X-xsMailingId Specifies a custom outbound Mailing/Campaign ID that will be used in logs and API events. Valid characters include 0-9, A-Z, a-z, and hyphen.

When bounce processing is enabled these IDs are added to the return path (enveloped sender) using Variable Return Path Encoding (VERP). Because of this, the length of these values should be as short as possible. The original SMTP specifications set a maximum to 64 characters, though most mail servers today will accept messages with user data larger than this. It is still a good idea to try and get as close to this as possible. For example, instead of using a GUID for the Message ID you may want to use an incremental number, and instead of using something like "NEWUSERSIGNUP" as the Mailing ID you may want to use "NUS".