From 91ae0e6c7165d371c93c268a8092a62feddad9e8 Mon Sep 17 00:00:00 2001 From: betimshahini Date: Fri, 9 Feb 2024 16:42:44 -0500 Subject: [PATCH] Tweaks sender string and sets reply-to address. (#2839) --- platform/emailinbounder/src/index.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/platform/emailinbounder/src/index.ts b/platform/emailinbounder/src/index.ts index e9bc5828d4..dd029d27dc 100644 --- a/platform/emailinbounder/src/index.ts +++ b/platform/emailinbounder/src/index.ts @@ -70,17 +70,22 @@ const relay = async (message: string, env: Environment) => { if (!sourceEmail) continue const from: MailChannelAddress = { - name: email.from.name, + name: `Rollup Hidden email from ${email.from.name}`, email: recipient.address, } + const replyTo: MailChannelAddress = { + name: email.from.name, + email: email.from.address, + } + const to: MailChannelAddress[] = [ { name: nickname, email: sourceEmail, }, ] - await send(email, from, to, dkim) + await send(email, from, to, replyTo, dkim) } } @@ -88,6 +93,7 @@ const send = async ( email: Email, from: MailChannelAddress, to: MailChannelAddress[], + replyTo: MailChannelAddress, dkim: DKIM ) => { const { subject } = email @@ -121,6 +127,7 @@ const send = async ( subject, content, personalizations, + reply_to: replyTo, }, null, 2