Mailer与断头台集成

guillotina-mailer的Python项目详细描述


guillotina_mailer

Configuration

config.json可以包含mailer部分:

"applications": ["guillotina_mailer"],
"mailer": {
  "default_sender": "foo@bar.com",
  "endpoints": {
    "default": {
      "type": "smtp",
      "host": "localhost",
      "port": 25
    }
  }
}

Printing mailer

对于开发/调试,可以使用控制台打印邮件程序:

"applications": ["guillotina_mailer"],
"mailer": {
  "default_sender": "foo@bar.com",
  "endpoints": {
    "default": {
      "type": "smtp",
      "host": "localhost",
      "port": 25
    }
  },
  "utility": "guillotina_mailer.utility.PrintingMailerUtility"
}

Sending mail

http://localhost:8080/zodb/container/@mailer

{
  "sender": "foo@bar.com",
  "recipient": "john@doe.com",
  "subject": "Some subject",
  "text": "Hello"
}

Permissions

guillotina\u mailer定义一个权限mailer.sendmail默认情况下, 只分配了guillotina.containerAdmin角色。

Using the mailer in code

您也可以在代码中直接使用邮件程序:

from guillotina.component import queryUtility
from guillotina_mailer.interfaces import IMailer
mailer = queryUtility(IMailer)
await mailer.send(recipient='john@doe.com', subject='This is my subject', text='Body of email')

1.1.3 (2019-06-18)

  • 限制断头台版本

1.1.2 (2018-11-21)

  • 添加用户名和密码选项 [血淋淋的]

1.1.1 (2018-11-15)

  • 修复获取空设置 [范希姆]

1.1.0 (2018-09-17)

  • 使用可检索的异步队列发送电子邮件 [范希姆]

1.0.5 (2018-09-12)

  • 修复测试 [范希姆]

1.0.4 (2018-09-12)

  • 修复队列 [范希姆]

1.0.3 (2018-09-12)

  • 修复以使用最新的断头台 [范希姆]

1.0.2 (2017-04-13)

  • 注册SMTP终结点 [范希姆]

1.0.1 (2017-04-10)

  • 删除对repoze.sendmail和事务的依赖关系 [范希姆]
  • 测试邮件程序未提供正确的签名 [范希姆]

1.0.0 (2017-04-04)

  • 从断头台移动的初始版本

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

推荐PyPI第三方库


热门话题
swing Java按钮/网格布局   java列出Google日历中的所有事件   java无效:单击API publisher test按钮后连接到后端时出错   带有内部赋值的java While循环导致checkstyle错误   java为什么trimToSize/ensureCapacity方法提供“公共”级访问?   文件输出流的java问题   ListIterator和并发修改异常的java问题   java如何使用两个URL映射   无法识别使用“./../”构造的字符串java相对路径,为什么?   首次写入remotelyclosedsocket不会触发异常,对吗?JAVA   java OneDrive REST API为文件上载提供了400个无效谓词   Java泛型、集合接口和对象类的问题   OpenSSL Java安全提供程序   jmeter java运行jmx禁用操作