node.js - 如何在节点 js 中禁用邮件预览(电子邮件模板)?
问题描述
我正在使用带有电子邮件模板的 nodemailer。我可以向用户发送电子邮件。我面临的唯一问题是每次都预览电子邮件。请你告诉我如何禁用它?
var email = new EmailTemplate({
message: {
from: 'abc@****.com',
},
// uncomment below to send emails in development/test env:
send: true,
transport: {
jsonTransport: true
},
preview:'production', // tried with production and development but is of no use
views: {
options: {
extension: 'ejs' // <---- HERE
}
}
});
解决方案
愚蠢的错误,但我只需要添加preview:false
推荐阅读
- java - 如何处理由于 Java 中的 hashmap 导致的内存泄漏
- c# - 在 Unity 中检测对象点击
- android - Android Intent to Gmail 未通过 FileProvider “无法附加文件”附加文件
- linux - Selenium 不在 cronjob 的路径中
- python - 将装饰元素均匀分布在墙上
- python - Python中的基本决策树
- tensorflow - 为什么 TensorFlow 中的分布策略不支持梯度裁剪?
- angular - 错误:尝试将嵌入式视图添加到时,ViewContainerRef.insert() 不是函数
- vim - GVim 代码折叠有不同的文本,具体取决于我打开文件的方式
- r - 在循环中使用 mutate 创建变量