Thread admin replies to original email via In-Reply-To/References headers

When replying to an inbound email that has a messageId, the outgoing
Resend payload now includes In-Reply-To and References headers so the
reply threads correctly in Gmail and other email clients.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
nmemmert
2026-06-30 11:36:11 -04:00
parent 118314d0d7
commit 77a4f9300f
+7 -1
View File
@@ -494,7 +494,13 @@ export function register(app) {
{ name: 'message_type', value: submission.messageType ?? 'general' },
{ name: 'submission_id', value: submission.id },
],
headers: { 'X-Contact-Submission-Id': submission.id },
headers: {
'X-Contact-Submission-Id': submission.id,
...(submission.messageId ? {
'In-Reply-To': submission.messageId,
'References': submission.messageId,
} : {}),
},
text,
html,
},