From d5c0cae60b5cf7834ca9d669f9408a7c55694ff9 Mon Sep 17 00:00:00 2001 From: Lucas Perais Date: Tue, 17 Oct 2017 09:37:08 +0200 Subject: [PATCH] [FIX] mass_mailing: background snippet option outlook compatible (#20137) Origin of the fix: the snippet background image did not change the background image. This was due to commit a14f89c which wraps the snippet's content into a table for outlook display compliance This issue is fixed here, with the modificaion of the background snippet option. OPW 772442 --- .../mass_mailing/static/src/js/mass_mailing_editor.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/addons/mass_mailing/static/src/js/mass_mailing_editor.js b/addons/mass_mailing/static/src/js/mass_mailing_editor.js index 651e0c979e4..e9aff44ec84 100644 --- a/addons/mass_mailing/static/src/js/mass_mailing_editor.js +++ b/addons/mass_mailing/static/src/js/mass_mailing_editor.js @@ -281,4 +281,15 @@ if ($("#editable_area").html().indexOf('on_change_model_and_list') !== -1) { $("#editable_area").empty(); } +// Adding compatibility for the outlook compliance of mailings. +// Commit of such compatibility : a14f89c8663c9cafecb1cc26918055e023ecbe42 +options.registry.background.include({ + start: function() { + this._super(); + var $table_target = this.$target.find('table:first'); + if ($table_target) { + this.$target = $table_target; + } + } +}); });