无法发送Mandrill Handlebars模板API

时间:2017-01-30 00:54:18

标签: javascript email handlebars.js mailchimp mandrill

我正在尝试访问我在Mandrill应用程序(mandrillapp.com/templates)中使用模板构建器创建的Mandrill模板。

当我阅读他们的文档时,我被引导进行Ajax调用:

{
  "key": "<my api key>",
  "template_name": "<my template name as defined in Mandrill templates>",
  "template_content":[],
  "message": {
    "from_email": "<my from email>",
    "to": <[an array of emails defined above]>,
    "subject": "<my subject>",
    "merge":true,
    "global_merge_vars":[
        {
            "name": "visitorFirst",
            "content": visitorFirst
        },

            "name": "visitorLast",
            "content": visitorLast
        },
        {
            "name": "visitorEmail",
            "content": visitorEmail
        }
    ]
}

这会返回500错误。当我把内容放在&#34; template_content&#34; (哪个文档说不要为把手做,它至少发送,但不填充任何合并变量。我已经设置Mandrill期望Handlebars,而不是Mailchimp变量。

我做错了什么?

1 个答案:

答案 0 :(得分:0)

更改

"template_content":[]

"template_content":null

问题解决了。

相关问题