Prevent threading on Gmail with the X-Entity-Ref-ID email header

Prevent threading on Gmail with the X-Entity-Ref-ID email header

Problem

When sending transactional emails from your application that contain the same subject and sender (and within a short time frame), Gmail will sometimes treat these emails as part of the same conversation and put them into a thread.

More often than not, you probably want to separate these emails and force Gmail not to thread your transactional emails into a conversation.

Solution

Luckily, this can be easily be done by setting the X-Entity-Ref-ID email header to a unique value.

Once this is set, all subsequent sends will show up as separate emails threads.


Looking for an easier way?

Waypoint is an email API with a built-in email template builder. On Waypoint, we automatically set the X-Entity-Ref-ID to the message ID on Waypoint to prevent threading on all transactional email notifications.

Screenshot of Waypoint’s powerful transactional email template builder