Django的Mandrill事务电子邮件

djrill的Python项目详细描述


djrill集成了Mandrill事务 向Django发送电子邮件服务。

PROJECT STATUS: INACTIVE

As of April, 2016, Djrill is no longer actively maintained (other than security updates). It is likely to keep working unless/until Mandrill changes their APIs, but Djrill will not be updated for newer Django versions or Mandrill changes. (more info)

You may be interested in django-anymail, a Djrill fork that supports Mailgun, Postmark, SendGrid, and other transactional ESPs (including limited support for Mandrill).

一般来说,djrill与django的内置^{tt1}一起“工作”$ 包裹。它包括:

  • 支持HTML、附件、额外标题和 Django’s built-in email
  • 特定于Mandrill的扩展,如标记、元数据、跟踪和MailChimp模板
  • 可选支持Mandrill入站电子邮件和其他Webhook通知, 通过Django信号

Djrill是根据BSD许可证发布的。对django 1.4-1.9进行了测试 (包括Python3和Django1.6+,以及Pypy支持Django1.5+)。 djrill使用semantic versioning

build status on Travis-CI

资源

djrill 1-2-3

  • 从pypi安装djrill:

    $ pip install djrill
    
  • 编辑项目的settings.py

    INSTALLED_APPS=(..."djrill")MANDRILL_API_KEY="<your Mandrill key>"EMAIL_BACKEND="djrill.mail.backends.djrill.DjrillBackend"DEFAULT_FROM_EMAIL="you@example.com"# if you don't already have this in settings
  • 现在是常规的Django email functions 将通过卷轴发送:

    fromdjango.core.mailimportsend_mailsend_mail("It works!","This will get sent through Mandrill","Djrill Sender <djrill@example.com>",["to@example.com"])

    您可以发送一条html消息,其中包含自定义的mandrill标记和元数据:

    fromdjango.core.mailimportEmailMultiAlternativesmsg=EmailMultiAlternatives(subject="Djrill Message",body="This is the text email body",from_email="Djrill Sender <djrill@example.com>",to=["Recipient One <someone@example.com>","another.person@example.com"],headers={'Reply-To':"Service <support@example.com>"}# optional extra headers)msg.attach_alternative("<p>This is the HTML email body</p>","text/html")# Optional Mandrill-specific extensions:msg.tags=["one tag","two tag","red tag","blue tag"]msg.metadata={'user_id':"8675309"}# Send it:msg.send()
  • full documentation 更多功能和选项。

    欢迎加入QQ群-->: 979659372 Python中文网_新手群

    推荐PyPI第三方库


    热门话题
    java获取TaskCompletionSource工作(Firestore的Android任务)   从PNG文件获取java或信息   neo4j嵌入式版本2.3.8的java NotInTransactionException   OSGI框架的java Eclipse启动配置在Mac上不起作用   java svn:“预提交”挂钩失败,输出错误:   java中ResourceBundle的io查询   java声明变量的最佳方法是什么?遵循下面的例子?   java如何在log4j中获得不同的记录器?   hibernate错误“java.lang.NoSuchMethodError:org.jboss.logging.Logger.getMessageLogger”   swing将JPanel保存为图像   eclipse(Java Spigot)我的PlayerInteractEvent有问题   使用java nio从FileChannel读取的字符串   java Eclipse无法清理生成输出   安卓对Eclipse java组件中的代码行数有限制吗   java Android Studio将应用程序推到手机上,不会让我   针对具有两个编辑器的页面的selenium java代码自动化   Java正则表达式:负前瞻   JavaJPA:基于实例变量将实体动态映射到表