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)
- 从断头台移动的初始版本