我試圖發送一個模板電子郵件郵戳在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我很高興,謝謝你嘗試模板。我們認爲他們很棒。 –