[IMP] mass_mailing: removed font-family from plain text

Purpose behind this commit is to remove font-family from all elements in
plaintext theme. So mail receiver will see this mail in default system font.
This is inspired by new Gmail and suggested by FP

As we want to show system's default font in the mail sent with the basic theme.
And so we remove font-family from basic theme while saving. But by doing so in
readonly mode is not getting proper font in odoo as we don't having any assets in
readonly mail editor. So we added stylesheet just for display purpose.
This commit is contained in:
Anshuman Sharma
2018-08-13 11:34:34 +02:00
committed by Christophe Matthieu
parent 7f0cc6ac52
commit 590679f868
3 changed files with 18 additions and 0 deletions
@@ -0,0 +1,7 @@
/* We want to show system's default font in the mail sent with the basic theme.
And so we remove font-family from basic theme while saving. But by doing so
in readonly mode is not getting proper font in odoo. So we added if from here.
*/
#wrapwrap .o_layout.o_basic_theme {
font-family: -apple-system, "HelveticaNeue", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
}
@@ -366,6 +366,14 @@ snippets_editor.Class.include({
self._disableUndroppableSnippets();
}
},
cleanForSave: function () {
this._super.apply(this, arguments);
// remove font-family from all elements for plain text theme (just like gmail)
var $basicTheme = this.$editable.find('.o_basic_theme');
if($basicTheme.length && this.$editable.data('oe-model') === 'mail.mass_mailing') {
this.$editable.find('*').css('font-family', '');
}
}
});
var callback = window ? window["callback"] : undefined;
@@ -13,6 +13,9 @@
<t t-call-assets="mass_mailing.assets_mail_themes"/>
<script type="text/javascript" src="/mass_mailing/static/src/js/mass_mailing_editor.js"></script>
</t>
<t t-else="">
<link rel="stylesheet" href="/mass_mailing/static/src/css/basic_theme_readonly.css" type="text/css"/>
</t>
<base target="_parent"/>
</t>
<t t-set="head" t-value="head_mm_field_text_html_inline + (head or '')"/>