Convert styles to inline styles and make them play nice with emails.
This module sole usage is to provide the same parsing functionality as in the web editor but for the templates imported directly in database.
auto_awesome What this module does
AI-generated from the code · Odoo 18.0This module automatically converts CSS styles written in a style block inside email templates into inline styles, so emails look correct in most email clients. It works on templates stored directly in the database.
When an email is generated from a template, this module rewrites the HTML so that the CSS rules defined in a <style> block are applied directly to the matching elements as inline styles. This is done automatically every time a template is rendered, without the user having to change anything.
- It extends the
mail.templatemodel and adds a post-processing step after the template is rendered. - It uses the external Python library
premailerto perform the transformation. - If the rendered HTML is empty, it is returned unchanged.
- The transformation options can be customised by overriding the
_get_premailer_optionsmethod, but by default no extra options are set. - A demo template named "Inline styles demo" is included to show how a template with embedded CSS is rendered with inline styles.
This module does not add any new menus, buttons, or screens. It only changes the behaviour of existing email templates. It is useful for templates imported directly into the database, where the Odoo web editor is not used to prepare the styles.
Depends on
Models and fields (1)
- mail.template · extends an existing model
Text generated by AI (DeepSeek) from reading the Odoo 18.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub
Availability by version
Reviewed: 2026-11-03Confirmation status: 5 confirmed, 4 with no information of 9 versions.
Sources · Odoo 14.0
Confirmed on 2026-11-03 in branch 14.0 of OCA/social.
terminal Installation and usage
No verified informationInstallation instructions, the distribution package, dependencies and configuration steps are not shown because they have not yet been verified in the module documentation for any version.
Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.