Django软件包,用于创建经常联系的电子邮件营销活动
django-constant-contact的Python项目详细描述
django恒定触点
Django软件包,用于持续创建电子邮件营销活动 联系。
在发送到常量联系人之前,将css内联到html中。
安装
使用pip:
pip install django-constant-contact
设置
应在设置中设置以下变量。py:
CONSTANT_CONTACT_API_KEY CONSTANT_CONTACT_ACCESS_TOKEN CONSTANT_CONTACT_FROM_EMAIL CONSTANT_CONTACT_REPLY_TO_EMAIL CONSTANT_CONTACT_USERNAME CONSTANT_CONTACT_PASSWORD
CONSTANT_CONTACT_API_KEY由常量contact分配 注册你的申请。(您需要注册为固定联系人 显影剂。)
CONSTANT_CONTACT_ACCESS_TOKEN是授予您的 由固定联系人用户应用。这是将拥有 上传的持续联系电子邮件营销活动。
用法示例
创建新的营销活动:
email_content="<html>....</html>"text_content="blah blah blah"constant_contact=ConstantContact()options={name:,from_email:,email_content:,text_content:,....}try:campaign=constant_contact.new_email_marketing_campaign(options)exceptConstantContactAPIErrorasexc:printexc.errors
更新现有的活动(存储在模型中):
options['email_marketing_campaign']=campaignoptions['name']="new name"try:constant_contact.update_email_marketing_campaign(options)exceptConstantContactAPIErrorasexc:printexc.errors