将邮戳电子邮件服务与金字塔Web应用程序集成。
pyramid_postmark的Python项目详细描述
[金字塔邮戳][]是一个集成[邮戳][]电子邮件发送
服务和[金字塔][]Web应用程序的包。例如,要使用模板发送电子邮件:
spec='mypackage:template s/newsletter.tmpl'
email=request.render_email('a@b.com','b@c.com','subject',spec)
request.send_email(email)
配置的“postmark.pmbatchmail”实例
*`request.send\u email`发送一个或多个电子邮件的函数
*`request.email\u factory`实例化电子邮件
*`request.render\u email`使用模板实例化电子邮件
这些默认情况下与[pyramid\u][]事务机制集成,因此
只有在当前请求成功时才会发送电子邮件。
在金字塔应用程序的配置部分包含包:
html“body=”<;p>;boo<;/p>;',text“body=”boo')
')
或使用模板:
spec='mypackage:templates/mytemplate.tmpl'
data={'msg':'boo'}<;--作为变量传递给模板数据)
然后像这样发送电子邮件:
请求。发送电子邮件(电子邮件)
发送多封电子邮件:
请求。发送电子邮件([电子邮件,电子邮件]
您可以使用“postmark.should戋join戋tx”标志覆盖此选项,该标志位于
您的“ini”设置中:
邮戳中。应否将“join戋tx=false
或在调用“request.send戋email”时:
request.send戋email(email,should戋join戋tx=false)
您可以在后台发送电子邮件:
即:当要发送电子邮件时,它将使用以下代码在后台线程中发送:
安装“mock”,` nose和coverage,例如:
$nosetests——coverage——doctest——coverage-package-pyramid e-postmark-pyramide-postmark
……
name-stmts-miss-covern-missing
--------------------------
pyramide-postmark 5 0 100%
金字塔形邮戳。钩22 0 100%
---------------------------
总计27 0 100%
---------------------------------
在0.017s内进行了3次测试
确定
[邮戳]:http://postmarkapp.com
[邮戳Ender签名:http://developer.postmarkapp.com
[金字塔]:http://pyramid.readthedocs.org
[金字塔邮戳]:https://github.com/thruflo/pyramid\u邮戳
[金字塔]:http://pyramid\u.readthedocs.org
[Python邮戳]:https://github.com/themartorana/python邮戳
服务和[金字塔][]Web应用程序的包。例如,要使用模板发送电子邮件:
spec='mypackage:template s/newsletter.tmpl'
email=request.render_email('a@b.com','b@c.com','subject',spec)
request.send_email(email)
配置的“postmark.pmbatchmail”实例
*`request.send\u email`发送一个或多个电子邮件的函数
*`request.email\u factory`实例化电子邮件
*`request.render\u email`使用模板实例化电子邮件
这些默认情况下与[pyramid\u][]事务机制集成,因此
只有在当前请求成功时才会发送电子邮件。
在金字塔应用程序的配置部分包含包:
html“body=”<;p>;boo<;/p>;',text“body=”boo')
')
或使用模板:
spec='mypackage:templates/mytemplate.tmpl'
data={'msg':'boo'}<;--作为变量传递给模板数据)
然后像这样发送电子邮件:
请求。发送电子邮件(电子邮件)
发送多封电子邮件:
请求。发送电子邮件([电子邮件,电子邮件]
您可以使用“postmark.should戋join戋tx”标志覆盖此选项,该标志位于
您的“ini”设置中:
邮戳中。应否将“join戋tx=false
或在调用“request.send戋email”时:
request.send戋email(email,should戋join戋tx=false)
您可以在后台发送电子邮件:
即:当要发送电子邮件时,它将使用以下代码在后台线程中发送:
安装“mock”,` nose和coverage,例如:
$nosetests——coverage——doctest——coverage-package-pyramid e-postmark-pyramide-postmark
……
name-stmts-miss-covern-missing
--------------------------
pyramide-postmark 5 0 100%
金字塔形邮戳。钩22 0 100%
---------------------------
总计27 0 100%
---------------------------------
在0.017s内进行了3次测试
确定
[邮戳]:http://postmarkapp.com
[邮戳Ender签名:http://developer.postmarkapp.com
[金字塔]:http://pyramid.readthedocs.org
[金字塔邮戳]:https://github.com/thruflo/pyramid\u邮戳
[金字塔]:http://pyramid\u.readthedocs.org
[Python邮戳]:https://github.com/themartorana/python邮戳