电子邮件模板哈巴狗文件哈巴狗文件的绝对路径

时间:2019-06-13 17:53:09

标签: javascript node.js pug nodemailer email-templates

当我通过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

0 个答案:

没有答案