You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

109 lines
2.6 KiB

  1. .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
  2. :target: http://www.gnu.org/licenses/agpl
  3. :alt: License: AGPL-3
  4. ===============
  5. Mail Inline CSS
  6. ===============
  7. When you send HTML emails you can't use style tags but instead you have
  8. to put inline ``style`` attributes on every element. So from this:
  9. .. code:: html
  10. <html>
  11. <style type="text/css">
  12. h1 { border:1px solid black }
  13. p { color:red;}
  14. </style>
  15. <h1 style="font-weight:bolder">Peter</h1>
  16. <p>Hej</p>
  17. </html>
  18. You want this:
  19. .. code:: html
  20. <html>
  21. <h1 style="font-weight:bolder; border:1px solid black">Peter</h1>
  22. <p style="color:red">Hej</p>
  23. </html>
  24. This module use premailer library to do this.
  25. It parses an HTML page, looks up ``style`` blocks
  26. and parses the CSS. It then uses the ``lxml.html`` parser to modify the
  27. DOM tree of the page accordingly.
  28. Installation
  29. ============
  30. To install this module, you need first to install `premailer` python library with:
  31. .. code:: bash
  32. pip install premailer
  33. Usage
  34. =====
  35. Just use any mail template as Odoo standard feature
  36. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
  37. :alt: Try me on Runbot
  38. :target: https://runbot.odoo-community.org/runbot/205/11
  39. Note:
  40. Odoo with module web_editor already implements this feature on the client side (js).
  41. 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
  42. with adhoc python unit tests.
  43. Bug Tracker
  44. ===========
  45. Bugs are tracked on `GitHub Issues
  46. <https://github.com/OCA/social/issues>`_. In case of trouble, please
  47. check there if your issue has already been reported. If you spotted it first,
  48. help us smash it by providing detailed and welcomed feedback.
  49. Credits
  50. =======
  51. Images
  52. ------
  53. * Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
  54. Contributors
  55. ------------
  56. * David BEAL <david.beal@akretion.com>
  57. Do not contact contributors directly about support or help with technical issues.
  58. Funders
  59. -------
  60. The development of this module has been financially supported by:
  61. * Akretion
  62. Maintainer
  63. ----------
  64. .. image:: https://odoo-community.org/logo.png
  65. :alt: Odoo Community Association
  66. :target: https://odoo-community.org
  67. This module is maintained by the OCA.
  68. OCA, or the Odoo Community Association, is a nonprofit organization whose
  69. mission is to support the collaborative development of Odoo features and
  70. promote its widespread use.
  71. To contribute to this module, please visit https://odoo-community.org.