Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I Use Postmark to Create Threaded Replies?

Like many web apps, we use Postmark to send all notifications for server side events. Many of our events are grouped and related by something simple and logical (think multiple replies to the same issue, like in GitHub).

Right now, every email sent for these related events is it's own email thread. My question is: how do I send these emails so that related ones get pushed into the same thread?

I'm not sure if this is something at the Postmark level (like include a previous message ID) or if this is something I do with SMTP (like I should format my subject better and inline previous responses), so that's why I'm seeking guidance. Also, every Google search about: "Postmark email threads" returns concerns over the thread safety of the Ruby Gem.

For more information, the app is written in PHP and right now we are znarkus/postmark-php for sending emails and jjaffeux/postmark-inbound-php for parsing inbound ones. However, I am more than willing to add any extra packages if they help me in my quest.

Thanks in advance!

like image 425
hjc1710 Avatar asked Dec 04 '15 15:12

hjc1710


1 Answers

You can add a few SMTP headers with the original Message-ID that most clients use to link together replies. If the original email had a Message-ID header of <[email protected]> the new email you send out should keep the subject line the same and add headers of:

And that should inform clients that the two emails should be threaded.

Edit:

The value for these headers should be the SMTP Message-ID header, which is slightly confusing because it is a separate concept from the Postmark MessageID value, which is just a UUID for the email.

The SMTP Message-ID header is always in the form an email address, because that's how it's supposed to be formed, but doesn't have to be related to the from address.

like image 70
Nick Canzoneri Avatar answered Oct 22 '22 11:10

Nick Canzoneri