我正在尝试在 Node.js 中发送带有 Postmark 的模板电子邮件
我在 Postmark App 网站上创建了一个模板。我查看了他们的文档,但找不到任何发送模板电子邮件的方法。
文档来源:
http://blog.postmarkapp.com/post/125849089273/special-delivery-postmark-templates http://developer.postmarkapp.com/developer-api-templates.html
我尝试了多种方法,包括:
client.emailWithTemplate("jenny@example.com",
"bob@example.com",<template-id>, {
"link" : "https://example.com/reset?key=secret",
"recipient_name" : "Jenny"
});
TypeError: Object # has no method 'emailWithTemplate'
client.sendEmail({
"TemplateModel" : {
"customer_name" : "Jenny",
},
"TemplateId" : 6882,
"From": "info@formulastocks.com",
"To": "lrroberts0122@gmail.com",
}, function(error, success) {
if(error) {
console.log(error);
} else {
console.log(success);
}
});
控制台日志错误:{状态:422,消息:'A \'TemplateId\' 发送非模板电子邮件时不得使用。',代码:1123 }
谢谢!