我正在尝试在Google App Engine
上使用Mandrill
,并与Python
一起使用,为此我使用了Google提供的urlfetch
模块。在
我使用的代码的改编如下:
#The jMessage below was split with the formatting below to make it easier to follow
#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
其输出如下:
^{pr2}$它想要的数组到底是什么?我不知道该怎么做,所以我用jMessage
和{[]
,我也没有收到任何电子邮件。在
目前没有回答
相关问题 更多 >
编程相关推荐