我正在按照以下步骤使用Python Mailchimp API将电子邮件发送到联系人列表:
from mailchimp3 import MailChimp
my_html = """html here"""
html = {"html": my_html}
client = MailChimp(mc_api='xxxxxx', mc_user='xxxx')
data = {
"recipients":
{
"list_id": "xxxxxxxx"
},
"settings":
{
"subject_line": "Subject",
"from_name": "Name",
"reply_to": "email"
},
"type": "regular"
}
camp = client.campaigns.create(data=data)
client.campaigns.content.update(campaign_id=camp['id'], data=html)
client.campaigns.actions.send(campaign_id=camp['id'])
现在,我要为此广告系列附加一个.pdf文档(保存在本地磁盘中)。我一直在寻找解决方案,但一直无法找到通过电子邮件附加pdf文档的方法。任何帮助将不胜感激