【发布时间】:2017-05-23 04:41:57
【问题描述】:
所以我试图将一些变量(数字)数据传递给电子邮件模板。我正在尝试像这样使用 ejs:
var compiled = ejs.compile(fs.readFileSync(path_to_file, 'utf-8'));
const mailOptions = {
from: app.get('senderMail'),
// Atention***********************
// Let this hardcoded otherwise it will send email to all db
to: email,
subject: sujbjet,
text: 'Hello Word',
html: compiled({number : number})
};
在我的 html 代码中,我试图呈现如下内容:
<span> <=% number %> </span>
但我没有得到“数字”的实际值。它呈现如下内容:
我有什么遗漏吗?
提前致谢
【问题讨论】: