Fix the email editor so that it doesn't rewrite/strip code from our responsive email templates

Fix the email editor so that it doesn't rewrite/strip code from our responsive email templates

Per the discussion thread that I started here, Marketo Support confirmed back to me that the email editor does not retain specific code in the <head> of the template; and strips out specific conditional code (media queries) that are essential especially for responsive emails.  Please fix this so that our code is not being rewritten or stripped from our email templates.

I know there already is an idea (since 2013) that is specific to stripping out conditional code within the HTML.  This idea covers more than just the conditional code.  So please don't merge this with that idea.

Our template:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office">
<head>

Marketo rewrite:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

Our template:
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--[if gte mso 9]><xml>
  <o:OfficeDocumentSettings>
    <o:AllowPNG/>
    <o:PixelsPerInch>96</o:PixelsPerInch>
  </o:OfficeDocumentSettings>
</xml><![endif]-->

Marketo rewrite: completely stripped out.  Basically, Marketo is stripping out any conditional code that starts with "<!--[if gte mso 9]>"

14 Comments
Dan_Stevens_
Level 10 - Champion Alumni
Great to see this is being worked on!  Please feel free to reach out to me to get additional input into this issue.  I have confirmed that when the code isn't being stripped out - which I tested using another email service provider's platform (Campaign Monitor) - the email is rendered properly across all Windows scaling environments.  In summary, all code within the <DOCTYPE>, <HTML> (specifically the XML namespace declaration), and <HEAD> areas must be preserved and not overwritten for this to work. 
Anonymous
Not applicable

This is absolutely essential to fix. I have some grumpy clients at the moment whose emails are not rendering correctly under certain circumstances.

Anonymous
Not applicable

Personally, I'd like the option to turn off code clean-up entirely so that we can address whatever other fixes are necessary going forward without having to worry about what the WYSIWYG editor might do to our code.

Dan_Stevens_
Level 10 - Champion Alumni

While I agree that code cleanup in the wysiwyg editor often causes more harm than good, the other issue - actually the main one that Marketo has yet to fix - has nothing to do with the editor. It's simply stripping out compliant code that's pasted/entered into the HTML window of the template. ​

Anonymous
Not applicable

I see. I assumed that was a code clean up feature as well. (That it ran on the code whether you were viewing the code as HTML or in the WYSIWYG.)

Justin_Cooperm2
Level 10

We will be releasing this feature with a patch outside of our normal release schedule and I want to explain how it will work. The items will be applied to our production code tonight (10/13) and will be available for activation starting tomorrow. It will not be turned on automatically for all customers. We will, however, enable the feature on an ad-hoc basis for those that are interested. If you would like this feature enabled, please email me atjcooperman@marketo.com and tell me the Munchkin ID of your subscription.

While this functionality has been thoroughly tested, we won't be enabling this for all customers for 1-2 months. It is a large change and it is important that you understand (and communicate to your team) the behavior before choosing to enable this.

With this feature enabled, you will see the following behavior:

  • Custom DOCTYPES will not be stripped from your Email Templates when creating new Emails in Marketo.
  • Custom HTML attributes will not be stripped from your Email Templates when creating new Emails in Marketo.

         Please Note:

    • Your custom DOCTYPE will persist only if it is the very first line of your Email Template or what you are pasting into Email Actions > HTML Tools > Replace HTML. If the DOCTYPE is anywhere else, it will be stripped and replaced with Marketo's default DOCTYPE.
    • If you have existing Email Templates that already have custom DOCTYPES, they will now persist into your new Emails once the feature is enabled. Because this is a change from today's behavior, we highly recommend you make sure this will not cause issues for your existing emails. Same goes for existing Email Templates with custom HTML attributes.
    • If you omit a DOCTYPE in your Email Template or what you paste into Email Actions > HTML Tools > Replace HTML, the default Marketo DOCTYPE will still be added. You cannot create an Email without a DOCTYPE.
    • The Email Template "Preview" option will not show your custom DOCTYPE. This is expected so you can disregard this. Your emails will still have the DOCTYPE. This also applies to custom HTML attributes.

Again, please reach out directly if you'd like this enabled starting tomorrow (10/14) for your subscription. We will roll this out to all customers shortly after.

Thanks,

Justin

Justin_Cooperm2
Level 10

This is now in our production environment!

I've only received two requests to enable the feature. Please don't be shy! Let me know if you want this enabled in your subscription and make sure you tell your team about the behavior change (noted above).

Dan_Stevens_
Level 10 - Champion Alumni

I just finished testing... AND IT WORKS!!!!  Thanks so much, Justin Cooperman​!  BTW, it's not just the DOCTYPE that caused the issues, but Marketo was also stripping the xmlns definitions within the <HTML> tag, just after the DOCTYPE.  These critical three lines of code are also being preserved.

Anonymous
Not applicable

So is this only fixing the Doctype issue and not the text editor auto stripping code out?

Dan_Stevens_
Level 10 - Champion Alumni

No this also preserves the code contained within the <HTML> tag above the <head> area:

<html xmlns="http://www.w3.org/1999/xhtml"

xmlns:v="urn:schemas-microsoft-com:vml"

xmlns:o="urn:schemas-microsoft-com:office:office">