当我通过node-mailer使用电子邮件模板发送邮件时 我想调用/emails/booked/html.pug
之类的模板路径const email = new Email({
transport: transporter,
send: true,
preview: false,
});
try{
email.send({
template: `booked`,
message: {
from: 'f@gmail.com',
to: '123@.gmail.com',
subject: 'booed ticket',
text: " "
},
});
} catch(error){console.log("got error while sending email ===========>>>", error)}
当前目录结构如下:
=>config
=>controllers=>play.js
=>emails => template_name => html.pug
=>logs
=>routes
=>main.js
我想在这里调用一个变量 包含可以存储在模板上的模板的路径 服务器或AWS路径可能类似于:/emails/booked/html.pug