与guillotina集成的Mailer
项目描述
guillotina_mailer
配置
config.json可以包含Mailer部分
"applications": ["guillotina_mailer"], "mailer": { "default_sender": "foo@bar.com", "endpoints": { "default": { "type": "smtp", "host": "localhost", "port": 25 } } }
打印Mailer
对于开发/调试,您可以使用控制台打印Mailer
"applications": ["guillotina_mailer"], "mailer": { "default_sender": "foo@bar.com", "endpoints": { "default": { "type": "smtp", "host": "localhost", "port": 25 } }, "utility": "guillotina_mailer.utility.PrintingMailerUtility" }
发送邮件
POST http://localhost:8080/zodb/container/@mailer
{ "sender": "foo@bar.com", "recipient": "john@doe.com", "subject": "Some subject", "text": "Hello" }
权限
guillotina_mailer 定义了一个权限 mailer.SendMail,默认情况下,只有 guillotina.ContainerAdmin 角色被分配。
在代码中使用Mailer
您也可以直接在代码中使用Mailer
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)
限制guillotina版本
1.1.2 (2018-11-21)
添加用户名和密码选项[bloodbare]
1.1.1 (2018-11-15)
修复获取空设置[vangheem]
1.1.0 (2018-09-17)
使用可重试的异步队列发送电子邮件[vangheem]
1.0.5 (2018-09-12)
修复测试[vangheem]
1.0.4 (2018-09-12)
修复队列[vangheem]
1.0.3 (2018-09-12)
修复以与最新guillotina兼容[vangheem]
1.0.2 (2017-04-13)
注册smtp端点[vangheem]
1.0.1 (2017-04-10)
移除对repoze.sendmail和transaction的依赖[vangheem]
测试Mailer未提供正确的签名[vangheem]
1.0.0 (2017-04-04)
从guillotina_mailer迁移初始版本
项目详情
关闭
guillotina_mailer-1.1.3.tar.gz 的散列值
算法 | 散列值 | |
---|---|---|
SHA256 | b42def8eb31fe4371c216936f4bcf81207dd27e607392c12db52d7b913059301 |
|
MD5 | 38558b9fb28596226cbcebdb09a1cfba |
|
BLAKE2b-256 | e34ebb0628b64e00e850126e987d121cfe4cdd6133128a35bcf8231efe2ac6d0 |