From 77a4f9300f7cc9ded0ff22344c630474cc3b638c Mon Sep 17 00:00:00 2001 From: nmemmert Date: Tue, 30 Jun 2026 11:36:11 -0400 Subject: [PATCH] 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 --- server/routes/contact.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/routes/contact.js b/server/routes/contact.js index 2f86867..e9c826c 100644 --- a/server/routes/contact.js +++ b/server/routes/contact.js @@ -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, },