2017-01-30 100 views
0

我想要访问我在Mandrill应用程序(mandrillapp.com/templates)中使用其模板构建器制作的Mandrill模板。不能发送Mandrill把手模板API

当我读到他们的文档导致我做出一个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错误。当我把内容放在“template_content”内时(文档中说不要处理栏,它至少发送,但不填充任何合并变量。我已经设置Mandrill以期望Handlebars,而不是Mailchimp变量。

我在做什么错?

回答

0

变化

"template_content":[] 

"template_content":null 

问题解决了。