Mandrill验证错误:请输入数组

时间:2014-10-20 19:29:39

标签: python google-app-engine mandrill urlfetch

我想Mandrill Google App Engine使用Pythonurlfetch,我可以使用Google提供的#The jMessage below was split with the formatting below to make it easier to follow模块

使用的代码I' m的改编如下:

#the real code doesn't have such indentation issues jMessage = { "key": mailchimp_key, "message": { "track_clicks": False, "track_opens": True, "tags": [], "google_analytics_domains": [], "html": message_html, "subject": "Reset your password", "from_name": None, "merge_var_map": {}, "auto_text": False, "from_email": from_email, "headers": {}, "google_analytics_campaign": [], "merge_vars": [], "text": None, "global_merge_vars": [], "url_strip_qs":False, "to": [ { "email": to_email, "name": None } ] } } headers = {'content-type': 'application/json'} result = urlfetch.fetch(url='https://mandrillapp.com/api/1.0/messages/send.json',\ headers=headers, payload=json.dumps(jMessage), method=urlfetch.POST) print result.content

{"status":"error","code":-2,"name":"ValidationError","message":"Validation error{\"message\":\"Please enter an array\"}"}

输出结果如下:

jMessage

它想要的阵列究竟是什么?我不确定该怎么做,所以我把#34;消息"密钥,来自[][],使其成为一个列表。实际上,它停止了抱怨数组,但输出只是{{1}},我没有收到任何电子邮件。

0 个答案:

没有答案