Skip to content

Commit

Permalink
Merge PR #6 into 18.0
Browse files Browse the repository at this point in the history
Signed-off-by hbrunn
  • Loading branch information
OCA-git-bot committed Dec 27, 2024
2 parents 0aafcd9 + 564e39f commit 96bc9b8
Show file tree
Hide file tree
Showing 24 changed files with 1,207 additions and 0 deletions.
99 changes: 99 additions & 0 deletions mail_inline_css/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
===============
Mail Inline CSS
===============

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:e3cd02099a2beb9db6980920f3d0547a5154e4a386f2f3e3bf189342a85a2110
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fmail-lightgray.png?logo=github
:target: https://github.com/OCA/mail/tree/18.0/mail_inline_css
:alt: OCA/mail
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/mail-18-0/mail-18-0-mail_inline_css
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/mail&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

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.

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/mail/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/mail/issues/new?body=module:%20mail_inline_css%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Akretion
* camptocamp

Contributors
------------

- David BEAL <[email protected]>

- Akim Juillerat <[email protected]>

- Simone Orsi <[email protected]>

- Patrick Tombez <[email protected]>

- Phuc Tran Thanh <[email protected]>

- `Trobz <https://trobz.com>`__:

- Son Ho <[email protected]>
- Khoi Vo <[email protected]>

Other credits
-------------

The migration of this module from 16.0 to 18.0 was financially supported
by Camptocamp

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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.

This module is part of the `OCA/mail <https://github.com/OCA/mail/tree/18.0/mail_inline_css>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions mail_inline_css/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
17 changes: 17 additions & 0 deletions mail_inline_css/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2017 David BEAL @ Akretion
# Copyright 2019 Camptocamp SA

# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Mail Inline CSS",
"summary": "Convert style tags in inline style in your mails",
"version": "18.0.1.0.0",
"author": "Akretion, camptocamp, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/mail",
"license": "AGPL-3",
"category": "Tools",
"installable": True,
"external_dependencies": {"python": ["premailer"]},
"depends": ["mail"],
"demo": ["demo/demo_mail_template.xml"],
}
102 changes: 102 additions & 0 deletions mail_inline_css/demo/demo_mail_template.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="0">
<record id="email_template_demo" model="mail.template">
<field name="name">Inline styles demo</field>
<field name="model_id" ref="base.model_res_users" />
<field name="subject">Demo email inline styles</field>
<field name="body_html" type="html">
<html>
<body>
<!-- TODO: move to LESS file
If we put the link as it is `premailer` won't be able to render it.
To ease this, we could:
1. find the less file on FS
2. compile to less
3. populate style block
-->
<style>
#main_wrapper {
max-width: 620px;
margin: 0 auto;
border: 1px solid #ccc;
font-size: 18px;
font-family: verdana;
color: #6B6E71;
}
a { color: #3BA0A6; text-decoration: none }
#main_header, footer, main div { padding: 30px 40px }
#main_header table { width: 100% }
#main_header table td { width: 50% }
#main_logo { max-width: 300px }
#main_header .right {
text-align: right;
vertical-align: top;
font-size: 140%;
}
#main_header .date_today { text-transform: uppercase; opacity: 0.7; color: #FF0000 }
footer { padding-top: 0; font-size: 120% }
footer address { font-style: normal }
.greeting { padding-top: 0; padding-bottom: 0 }
.image-wrapper {
min-height: 250px;
}
.image-wrapper.location-map {
margin: 0 -40px;
}
.pt0 { padding-top: 0 }
a.contact { cursor: pointer }
</style>
<div id="main_wrapper">
<div id="main_header">
<table>
<tbody>
<tr>
<td class="left">
<img
id="main_logo"
t-attf-src="data:image;base64,{{env.user.company_id.logo}}"
/>
</td>
<td class="right">
<span
class="date_today"
t-esc="time.strftime('%%d %%B %%Y')"
/>
</td>
</tr>
</tbody>
</table>
</div>
<main id="main_content">
<div class="greeting">
<p>Hello <span t-field="object.name" />.</p>
</div>
<div id="content">
<p
>This e-mail styles are inline rendered although its template defines styles as embedded CSS!</p>
</div>
</main>
<footer id="main_footer">
<div class="company_info">
<p class="website">
<a
href="https://www.example.com"
>www.example.com</a>
</p>
<div class="address">
<div
t-field="env.user.company_id.partner_id"
t-options='{
"widget": "contact",
"fields": ["name", "address", "phone", "mobile", "email"]
}'
/>
</div>
</div>
</footer>
</div>
</body>
</html>
</field>
</record>
</odoo>
51 changes: 51 additions & 0 deletions mail_inline_css/i18n/de.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_inline_css
#
# Translators:
# Niki Waibel <[email protected]>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-01-16 03:47+0000\n"
"PO-Revision-Date: 2018-01-16 03:47+0000\n"
"Last-Translator: Niki Waibel <[email protected]>, 2018\n"
"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: mail_inline_css
#: model:mail.template,subject:mail_inline_css.email_template_demo
msgid "Demo email inline styles"
msgstr ""

#. module: mail_inline_css
#: model:ir.model,name:mail_inline_css.model_mail_template
msgid "Email Templates"
msgstr "E-Mail Vorlagen"

#. module: mail_inline_css
#: model_terms:ir.ui.view,arch_db:mail_inline_css.demo_email_hello
msgid "Hello"
msgstr ""

#. module: mail_inline_css
#: model:mail.template,name:mail_inline_css.email_template_demo
msgid "Inline styles demo"
msgstr ""

#. module: mail_inline_css
#: model_terms:ir.ui.view,arch_db:mail_inline_css.demo_email_hello
msgid ""
"This e-mail styles are inline rendered although its template defines styles "
"as embedded CSS!"
msgstr ""

#. module: mail_inline_css
#: model_terms:ir.ui.view,arch_db:mail_inline_css.demo_email_hello
msgid "www.example.com"
msgstr ""
46 changes: 46 additions & 0 deletions mail_inline_css/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_inline_css
#
# Translators:
# Pedro M. Baeza <[email protected]>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-01-16 03:47+0000\n"
"PO-Revision-Date: 2018-01-16 03:47+0000\n"
"Last-Translator: Pedro M. Baeza <[email protected]>, 2018\n"
"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: mail_inline_css
#: model:mail.template,subject:mail_inline_css.email_template_demo
msgid "Demo email inline styles"
msgstr ""

#. module: mail_inline_css
#: model:ir.model,name:mail_inline_css.model_mail_template
msgid "Email Templates"
msgstr "Plantillas de correo electrónico"

#. module: mail_inline_css
#: model_terms:ir.ui.view,arch_db:mail_inline_css.demo_email_hello
msgid "Hello"
msgstr ""

#. module: mail_inline_css
#: model_terms:ir.ui.view,arch_db:mail_inline_css.demo_email_hello
msgid ""
"This e-mail styles are inline rendered although its template defines styles "
"as embedded CSS!"
msgstr ""

#. module: mail_inline_css
#: model_terms:ir.ui.view,arch_db:mail_inline_css.demo_email_hello
msgid "www.example.com"
msgstr ""
47 changes: 47 additions & 0 deletions mail_inline_css/i18n/es_MX.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * mail_inline_css
#
# Translators:
# OCA Transbot <[email protected]>, 2018
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 10.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-01-16 03:47+0000\n"
"PO-Revision-Date: 2018-01-16 03:47+0000\n"
"Last-Translator: OCA Transbot <[email protected]>, 2018\n"
"Language-Team: Spanish (Mexico) (https://www.transifex.com/oca/teams/23907/"
"es_MX/)\n"
"Language: es_MX\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"

#. module: mail_inline_css
#: model:mail.template,subject:mail_inline_css.email_template_demo
msgid "Demo email inline styles"
msgstr ""

#. module: mail_inline_css
#: model:ir.model,name:mail_inline_css.model_mail_template
msgid "Email Templates"
msgstr "Plantillas de Correo Electrónico"

#. module: mail_inline_css
#: model_terms:ir.ui.view,arch_db:mail_inline_css.demo_email_hello
msgid "Hello"
msgstr ""

#. module: mail_inline_css
#: model_terms:ir.ui.view,arch_db:mail_inline_css.demo_email_hello
msgid ""
"This e-mail styles are inline rendered although its template defines styles "
"as embedded CSS!"
msgstr ""

#. module: mail_inline_css
#: model_terms:ir.ui.view,arch_db:mail_inline_css.demo_email_hello
msgid "www.example.com"
msgstr ""
Loading

0 comments on commit 96bc9b8

Please sign in to comment.