在邮件中以内联样式转换样式标记
odoo10-addon-mail-inline-css的Python项目详细描述
邮件内联CSS
当你发送HTML邮件时,你不能使用样式标签,但是你有 在每个元素上放置内联style属性。所以从这里:
<html><styletype="text/css">h1{border:1pxsolidblack}p{color:red;}</style><h1style="font-weight:bolder">Peter</h1><p>Hej</p></html>
你想要这个:
<html><h1style="font-weight:bolder; border:1px solid black">Peter</h1><pstyle="color:red">Hej</p></html>
此模块使用预编译器库来执行此操作。
它解析一个html页面,查找style块 并解析css。然后使用lxml.html解析器修改 相应的页面的dom树。
安装
要安装此模块,首先需要使用以下命令安装预编译器python库:
pip install premailer
使用量
只需将任何邮件模板用作ODOO标准功能
注意:
Odoo with module web_editor already implements this feature on the client side (js). This module brings this server side feature for cases without js part. It could the more stable way over the Odoo versions with a stable api in a dedicated library with adhoc python unit tests.
缺陷跟踪器
在GitHub Issues上跟踪错误。如果有麻烦,请 如果您的问题已经报告,请检查那里。如果你先发现它, 通过提供详细且受欢迎的反馈,帮助我们粉碎它。
学分
图像
- 奥多社区协会:Icon。
资助者
本模块的开发得到了以下机构的资助:
- Akretion
维护人员
此模块由OCA维护。
oca,或odoo社区协会,是一个非营利性组织 任务是支持odoo特性和 促进其广泛应用。
若要对此模块作出贡献,请访问https://odoo-community.org。