OdooWiki OCA HUB

Mail Inline CSS

mail_inline_css folder_open OCA/mail open_in_new
Tools License: AGPL-3

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.0

This 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.template model and adds a post-processing step after the template is rendered.
  • It uses the external Python library premailer to perform the transformation.
  • If the rendered HTML is empty, it is returned unchanged.
  • The transformation options can be customised by overriding the _get_premailer_options method, 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

mail
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-03
Confirmed (verified in repository and branch) Estimated (unverified) No information

Confirmation status: 5 confirmed, 4 with no information of 9 versions.

terminal Installation and usage

No verified information

Installation 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.

info

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.