.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl
:alt: License: AGPL-3
===============
Mail Inline CSS
===============
When you send HTML emails you can't use style tags but instead you have
to put inline ``style`` attributes on every element. So from this:
.. code:: html
<html>
<style type="text/css">
h1 { border:1px solid black }
p { color:red;}
</style>
<h1 style="font-weight:bolder">Peter</h1>
<p>Hej</p>
</html>
You want this:
.. code:: html
<html>
<h1 style="font-weight:bolder; border:1px solid black">Peter</h1>
<p style="color:red">Hej</p>
</html>
This module use premailer library to do this.
It parses an HTML page, looks up ``style`` blocks
and parses the CSS. It then uses the ``lxml.html`` parser to modify the
DOM tree of the page accordingly.
Installation
============
To install this module, you need first to install `premailer` python library with:
.. code:: bash
pip install premailer
Usage
=====
Just use any mail template as Odoo standard feature
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/205/10
Note:
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.
Bug Tracker
===========
Bugs are tracked on `GitHub Issues
<https://github.com/OCA/social/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smash it by providing detailed and welcomed feedback.
Credits
=======
Images
------
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
Contributors
------------
* David BEAL <david.beal@akretion.com>
Do not contact contributors directly about support or help with technical issues.
Funders
-------
The development of this module has been financially supported by:
* Akretion
Maintainer
----------
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
This module is maintained by the OCA.
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
To contribute to this module, please visit https://odoo-community.org.
Raw data
{
"_id": null,
"home_page": "https://github.com/OCA/social",
"name": "odoo10-addon-mail-inline-css",
"maintainer": "",
"docs_url": null,
"requires_python": "~=2.7",
"maintainer_email": "",
"keywords": "",
"author": "Akretion, Odoo Community Association (OCA)",
"author_email": "support@odoo-community.org",
"download_url": "",
"platform": null,
"description": ".. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg\n :target: http://www.gnu.org/licenses/agpl\n :alt: License: AGPL-3\n\n===============\nMail Inline CSS\n===============\n\nWhen you send HTML emails you can't use style tags but instead you have\nto put inline ``style`` attributes on every element. So from this:\n\n.. code:: html\n\n <html>\n <style type=\"text/css\">\n h1 { border:1px solid black }\n p { color:red;}\n </style>\n <h1 style=\"font-weight:bolder\">Peter</h1>\n <p>Hej</p>\n </html>\n\nYou want this:\n\n.. code:: html\n\n <html>\n <h1 style=\"font-weight:bolder; border:1px solid black\">Peter</h1>\n <p style=\"color:red\">Hej</p>\n </html>\n\nThis module use premailer library to do this. \n\nIt parses an HTML page, looks up ``style`` blocks\nand parses the CSS. It then uses the ``lxml.html`` parser to modify the\nDOM tree of the page accordingly.\n\nInstallation\n============\n\nTo install this module, you need first to install `premailer` python library with:\n\n.. code:: bash\n\n pip install premailer\n\n\nUsage\n=====\n\nJust use any mail template as Odoo standard feature\n\n.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas\n :alt: Try me on Runbot\n :target: https://runbot.odoo-community.org/runbot/205/10\n\n\nNote:\n\n Odoo with module web_editor already implements this feature on the client side (js).\n 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 \n with adhoc python unit tests.\n\n\n\nBug Tracker\n===========\n\nBugs are tracked on `GitHub Issues\n<https://github.com/OCA/social/issues>`_. In case of trouble, please\ncheck there if your issue has already been reported. If you spotted it first,\nhelp us smash it by providing detailed and welcomed feedback.\n\nCredits\n=======\n\nImages\n------\n\n* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.\n\nContributors\n------------\n\n* David BEAL <david.beal@akretion.com>\n\nDo not contact contributors directly about support or help with technical issues.\n\nFunders\n-------\n\nThe development of this module has been financially supported by:\n\n* Akretion\n\nMaintainer\n----------\n\n.. image:: https://odoo-community.org/logo.png\n :alt: Odoo Community Association\n :target: https://odoo-community.org\n\nThis module is maintained by the OCA.\n\nOCA, or the Odoo Community Association, is a nonprofit organization whose\nmission is to support the collaborative development of Odoo features and\npromote its widespread use.\n\nTo contribute to this module, please visit https://odoo-community.org.\n\n\n",
"bugtrack_url": null,
"license": "AGPL-3",
"summary": "Convert style tags in inline style in your mails",
"version": "10.0.1.0.1",
"project_urls": {
"Homepage": "https://github.com/OCA/social"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a0a42aa0c555c4440490f627e9b6760bfa4642cc5d4f3dbac0240f7f76b0a906",
"md5": "f89d0a7f719fdd20bab94349e5ed665d",
"sha256": "b4d893a700a41f39da2d222e447077428514cffea84212268a8c4e3a29cf0813"
},
"downloads": -1,
"filename": "odoo10_addon_mail_inline_css-10.0.1.0.1-py2-none-any.whl",
"has_sig": false,
"md5_digest": "f89d0a7f719fdd20bab94349e5ed665d",
"packagetype": "bdist_wheel",
"python_version": "py2",
"requires_python": "~=2.7",
"size": 21888,
"upload_time": "2022-10-17T07:27:40",
"upload_time_iso_8601": "2022-10-17T07:27:40.358283Z",
"url": "https://files.pythonhosted.org/packages/a0/a4/2aa0c555c4440490f627e9b6760bfa4642cc5d4f3dbac0240f7f76b0a906/odoo10_addon_mail_inline_css-10.0.1.0.1-py2-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-10-17 07:27:40",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "OCA",
"github_project": "social",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "odoo10-addon-mail-inline-css"
}