我编写了以下代码来呈现我的hbs
文件并通过电子邮件发送。
const emailTemplateSource = fs.readFileSync(path.join(__dirname, 'account_verification.hbs"), "utf8");
const template = hbs.compile(emailTemplateSource);
const htmlToSend = template({message: url.toString()});
当我发送文件时,它将不包含我设置的URL。如果我传递一个简单的字符串就可以了。
const htmlToSend = template({message: "this works fine"});
这是我的hbs文件采用网址的方式
<a href= {{{message}}}>the lnk is</a>
此外,我的hbs
文件中的图像也不会呈现。