Skip to content

Commit

Permalink
Tweaks sender string and sets reply-to address. (#2839)
Browse files Browse the repository at this point in the history
  • Loading branch information
betimshahini authored Feb 9, 2024
1 parent 24dce18 commit 91ae0e6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions platform/emailinbounder/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,24 +70,30 @@ 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)
}
}

const send = async (
email: Email,
from: MailChannelAddress,
to: MailChannelAddress[],
replyTo: MailChannelAddress,
dkim: DKIM
) => {
const { subject } = email
Expand Down Expand Up @@ -121,6 +127,7 @@ const send = async (
subject,
content,
personalizations,
reply_to: replyTo,
},
null,
2
Expand Down

0 comments on commit 91ae0e6

Please sign in to comment.