微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用 mailchimp_transactional 客户端有什么问题?

如何解决使用 mailchimp_transactional 客户端有什么问题?

我收到此错误

  File "/Users/hernan0216/services/project/services/email.py",line 84,in _send_template
    result = self.client.messages.send_template(**data)
  File "/Users/hernan0216/services/venv/lib/python3.6/site-packages/mailchimp_transactional/api/messages_api.py",line 422,in send_template
    (data) = self.send_template_with_http_info(body,**kwargs)  # noqa: E501
  File "/Users/hernan0216/services/venv/lib/python3.6/site-packages/mailchimp_transactional/api/messages_api.py",line 438,in send_template_with_http_info
    " to method send_template" % key
TypeError: Got an unexpected keyword argument 'template_name' to method send_template

数据应该是这样的

data = {'template_name': 'name_template','template_content': [],'message': {'from_email': 'noreply@ex.com','from_name': 'Ex','subject': "some string",'to': [{'email': 'ex@example.com','name': 'Example','type': 'to'}],'global_merge_vars': [{'name': 'STUDENT_NAME','content': 'Example Name'}]}}

在mailchimp api docs 上为send_template 方法指定了Like

在mailchimp_transactional 客户端中我发现了这个code,也就是说只接受“body”作为关键字参数,我应该打开一个问题吗?应该在客户端、文档或 API 上??也许我遗漏了什么,如果是这样,抱歉。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。