From 6f560990b1418d80c2b4453b84ab3ff4f967c3cf Mon Sep 17 00:00:00 2001 From: Antoine Guenet Date: Thu, 24 Aug 2023 11:53:57 +0000 Subject: [PATCH] [FIX] mass_mailing: remove sidebar from conversion iframe When converting an email for compatibility with email clients, we move the contents of the editor iframe inside a new iframe, keeping only what's in the iframe target element. But we failed to remove the sidebar and other UI utils elements, which are irrelevant to the conversion. Additionally, failing to remove the sidebar from the conversion iframe made the snippets' images load again when committing changes. task-3323894 closes odoo/odoo#126845 Signed-off-by: David Monjoie (dmo) --- addons/mass_mailing/static/src/js/mass_mailing_html_field.js | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/mass_mailing/static/src/js/mass_mailing_html_field.js b/addons/mass_mailing/static/src/js/mass_mailing_html_field.js index c8ec19ccc6e..41edd25f0cf 100644 --- a/addons/mass_mailing/static/src/js/mass_mailing_html_field.js +++ b/addons/mass_mailing/static/src/js/mass_mailing_html_field.js @@ -141,6 +141,7 @@ export class MassMailingHtmlField extends HtmlField { const clonedBody = clonedHtmlNode.querySelector('body'); const clonedIframeTarget = clonedHtmlNode.querySelector('#iframe_target'); clonedBody.replaceChildren(clonedIframeTarget); + clonedBody.querySelector('.iframe-utils-zone').remove(); clonedHtmlNode.querySelectorAll('script').forEach(script => script.remove()); // Remove scripts. iframe.srcdoc = clonedHtmlNode.outerHTML; const iframePromise = new Promise((resolve) => {