2
0

feat(integration): ️ Add reply-to name on from field

This commit is contained in:
Baptiste Arnaud
2022-06-27 07:55:04 +02:00
parent 7b71ac9498
commit 75604bd3b1
2 changed files with 5 additions and 3 deletions

View File

@ -67,6 +67,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
resultValues: ResultValues
fileUrls?: string
}
const replyToName = replyTo?.split(' <')[0].replace(/"/g, '')
const { host, port, isTlsEnabled, username, password, from } =
(await getEmailInfo(credentialsId)) ?? {}
@ -104,7 +105,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
}
const transporter = createTransport(transportConfig)
const email: Mail.Options = {
from: `"${from.name}" <${from.email}>`,
from: `"${replyToName ?? from.name}" <${from.email}>`,
cc,
bcc,
to: recipients,