2
0

feat(editor): Add cc & bcc + Deletable credentials

This commit is contained in:
Baptiste Arnaud
2022-02-19 10:58:56 +01:00
parent c5972ec91b
commit b89e9b1b82
12 changed files with 210 additions and 38 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 } = JSON.parse(
const { credentialsId, recipients, body, subject, cc, bcc } = JSON.parse(
req.body
) as SendEmailOptions
@ -47,6 +47,8 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
})
const info = await transporter.sendMail({
from: `"${from.name}" <${from.email}>`,
cc: cc?.join(''),
bcc: bcc?.join(''),
to: recipients.join(', '),
subject,
text: body,