I am trying to send mail using nodemailer and want to pass html template to the nodemailer but not able to read the file on vecel. But it is working without any issue on my localhost.
const orderConfirmationTemplatePathForUser = "/public/mailTemplates/orderConfirmationTemplate.html";
const sourceForUser = (await fs.readFile(process.cwd() + orderConfirmationTemplatePathForUser, 'utf8')).toString();
folder structure(both src and public are at same level)
/src
/public
--/mailTemplates
----/orderConfirmationTemplate.html
Getting the below error only in vercel
[Error: ENOENT: no such file or directory, open '/var/task/public/mailTemplates/orderConfirmationTemplate.html'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/var/task/public/mailTemplates/orderConfirmationTemplate.html'
}
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742417376a4440003.html
评论列表(0条)