🚑 (bot) Fix custom email from field without name
This commit is contained in:
@ -23,7 +23,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
})
|
||||
try {
|
||||
const info = await transporter.sendMail({
|
||||
from: `"${from.name}" <${from.email}>`,
|
||||
from: from.name ? `"${from.name}" <${from.email}>` : from.email,
|
||||
to,
|
||||
subject: 'Your SMTP configuration is working 🤩',
|
||||
text: 'This email has been sent to test out your SMTP config.\n\nIf your read this then it has been successful.🚀',
|
||||
|
@ -95,10 +95,9 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
return res.status(404).send({ message: "Couldn't find email body" })
|
||||
}
|
||||
const transporter = createTransport(transportConfig)
|
||||
const fromName = isEmpty(replyToName) ? from.name : replyToName
|
||||
const email: Mail.Options = {
|
||||
from: `"${isEmpty(replyToName) ? from.name : replyToName}" <${
|
||||
from.email
|
||||
}>`,
|
||||
from: fromName ? `"${fromName}" <${from.email}>` : from.email,
|
||||
cc,
|
||||
bcc,
|
||||
to: recipients,
|
||||
|
Reference in New Issue
Block a user