Include Message-ID in API response for email threading
complete
J
Judicial Spoonbill
I need to be able to thread outgoing emails with replies for our use-case to work. Unfortunately, since the API doesn't provide the Message-ID, and there's no endpoint to retrieve a sent email, we're stuck. It would be beneficial if the Message-ID could be incorporated into the payload that Mailersend returns when an email is sent, or if there was a way to request the headers.
Agathe Brusset
Regarding the use case you're going for, when an email is sent, we are adding the Message-ID header. It contains {email_id}@mailersend.net (for example: Message-ID: <68d3d54be12345@mailersend.net>)
When someone replies to this email, this Message-ID is added to References and In-Reply-To header. Example:
References: <68d3d54be58ddcc1d8236721@mailersend.net>
In-Reply-To: <68d3d54be58ddcc1d8236721@mailersend.net>
When you send an email, a webhook is being sent to you and it includes:
"message_id":"6892766ae78995a317577aa1", "email_id":"6892766a8d52ba62543d5e71",
"email": "test@mailersend.com",
This means when you send an email, you get the message_id. This message can be split into multiple emails (95% of the time it's a single email), so you can register the email ID into your system for every recipient.
When you get a reply, you should take the In-Reply-To header, and you can assign the reply to a specific customer.
It's important to remember that the Message-ID header is built from email_id, and not message_id from our system. I understand that this can be a bit confusing but I hope this helps clarify the matter.
For more information, I recommend referring to this blog post:
https://www.mailersend.com/blog/email-threading
Agathe Brusset
marked this post as
complete