• Email DIY

Message-Level Email Tracking And More!

Mailgun Team
5 min read

Talk about a throwback; this was posted on August 29, 2011!

Good news everyone! Mailgun is migrating to a new and more powerful email pipeline, please expect a stream of exciting announcements very soon.

Message-level Tracking

For starters, we have added the option to fune-tune message tracking. Now Mailgun users can enable/disable tracking on a per-message level by adding a special X-Mailgun-Track MIME header. Set it to “yes” if you want this message to be tracked, or “no” if you wish to turn tracking off. Message level setting overrides domain-level tracking. Enjoy!

Here’s an example of how a raw MIME message looks with a message-level tracking enabled:

To: The World From: Mailgunners Subject: Message-level tracking demo X-Mailgun-Track: yes

Custom User Variables

When sending messages, you can now submit a JSON-dictionary of user-defined key-value pairs. Those variables will be passed back to your web application via Mailgun webhooks. This allows Mailgun users to build more sophisticated and flexible analytics on their end. Read more about webhooks and custom variables here.

Note that MIME allows you to have multiple headers with the same name, in that case Mailgun will merge your dictionaries as shown in this example:

To: The World From: Mailgunners Subject: User-defined variables demo X-Mailgun-Variables: {"first_name": "John", "last_name": "Smith"} X-Mailgun-Variables: {"my_message_id": 123}

When one of tracked events happens with message, Mailgun will post the following parameters via HTTP POST into your app: firstname, lastname and mymessageid.

sign up

It's easy to get started. And it's free.

What will you accomplish with 10,000 free emails and a 100 free validations every month?

Sign Up For Free

Last updated on September 04, 2019

  • Related posts
  • Recent posts
  • Top posts
View all

Always be in the know and grab free email resources!

No spam, ever. Only musings and writings from the Mailgun team.

Mailgun is committed to protecting your privacy. Please read ourPrivacy Policybefore providing us with your details.

sign up

It's easy to get started. And it's free.

What will you accomplish with 10,000 free emails and a 100 free validations every month?
Sign up for Free