我正在尝试使用 Mailchimp 模板通过 Mandrill API 发送电子邮件。我正在使用 Parse.com 在云代码中执行此操作,请参阅此处https://www.parse.com/docs/cloud_modules_guide#mandrill。电子邮件发送得很好,但是 mc:edit 字段从未更新。这是现在模板中的唯一内容:
<span mc:edit="ship_id">ship_id</span>
这就是我在 Javascript 中的调用的样子,希望有人看到我的错误。如果这有什么区别的话,我正在 Parse.com 云代码中运行它。多谢!
var Mandrill = require('mandrill');
Mandrill.initialize('api-key');
Mandrill.sendTemplate({
template_name: "Drip campaign",
template_content: [{
name: "ship_id",
content:"Test Test"
}],
message: {
text: "Hi",
subject: "You have new mail",
from_email: "[email protected]",
from_name: "Thomas",
to: [
{
email: "[email protected]",
name: "Fred"
}
],
"headers": {
"Reply-To": "[email protected]"
},
"important": false,
"track_opens": true,
"track_clicks": true,
},
async: true
},{
success: function(httpResponse) {
response.success("Email sent!");
},
error: function(httpResponse) {
console.error(httpResponse);
response.error("Uh oh, something went wrong");
}
});
}