我试图发送一个模板电子邮件邮戳在Node.js的邮戳:发送电子邮件模板
我创建的邮戳应用网站上的模板。我浏览过他们的文档,但无法找到发送模板电子邮件的方法。
文档来源:
http://blog.postmarkapp.com/post/125849089273/special-delivery-postmark-templates http://developer.postmarkapp.com/developer-api-templates.html
我已经尝试了多种方法,包括:
client.emailWithTemplate("[email protected]",
"[email protected]",<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": "[email protected]",
"To": "[email protected]",
}, function(error, success) {
if(error) {
console.log(error);
} else {
console.log(success);
}
});
Console Log Error: { status: 422, message: 'A \'TemplateId\' must not be used when sending a non-templated email.', code: 1123 }
谢谢!
哇!没有意识到这很简单。我刚刚在几天前得到了这个,但实际上它是1.0版本 - 现在我已经更新了,它的功能就像一个魅力。 – Lindsay
非常感谢你澄清这一点! :) – Lindsay
@Lindsay我很高兴,谢谢你尝试模板。我们认为他们很棒。 –