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.

101 lines
2.3 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/10
  39. Bug Tracker
  40. ===========
  41. Bugs are tracked on `GitHub Issues
  42. <https://github.com/OCA/social/issues>`_. In case of trouble, please
  43. check there if your issue has already been reported. If you spotted it first,
  44. help us smash it by providing detailed and welcomed feedback.
  45. Credits
  46. =======
  47. Images
  48. ------
  49. * Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
  50. Contributors
  51. ------------
  52. * David BEAL <david.beal@akretion.com>
  53. Do not contact contributors directly about support or help with technical issues.
  54. Funders
  55. -------
  56. The development of this module has been financially supported by:
  57. * Akretion
  58. Maintainer
  59. ----------
  60. .. image:: https://odoo-community.org/logo.png
  61. :alt: Odoo Community Association
  62. :target: https://odoo-community.org
  63. This module is maintained by the OCA.
  64. OCA, or the Odoo Community Association, is a nonprofit organization whose
  65. mission is to support the collaborative development of Odoo features and
  66. promote its widespread use.
  67. To contribute to this module, please visit https://odoo-community.org.