2
0

feat(integrations): 🚸 Add Reply-To field for email sending

This commit is contained in:
Baptiste Arnaud
2022-03-22 10:54:11 +01:00
parent d4022c6e3f
commit ddb6798eba
5 changed files with 39 additions and 3 deletions

View File

@ -27,7 +27,7 @@ const defaultFrom = {
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
await cors(req, res)
if (req.method === 'POST') {
const { credentialsId, recipients, body, subject, cc, bcc } = (
const { credentialsId, recipients, body, subject, cc, bcc, replyTo } = (
typeof req.body === 'string' ? JSON.parse(req.body) : req.body
) as SendEmailOptions
@ -50,6 +50,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
cc: cc?.join(''),
bcc: bcc?.join(''),
to: recipients.join(', '),
replyTo,
subject,
text: body,
})