SOLVED

Dynamic content removes inline styling?

Go to solution
Matt_Stone2
Level 9

Dynamic content removes inline styling?

I noticed an odd issue with some new templates we've rolled out concerning dynamic content. The issue stems only when making sections dynamic--the templates work flawlessly when content is static.

What appears to be happening is that when a section becomes dynamic, the inline styling of any elements within that section are ignored and substituted with the internal styling in the <head> section. The inline styling isn't erased from the actual code when you make the section dynamic, it's just ignored. Below are examples of what you see when an example is sent with static content, then what happens when it's dynamic. It's also worth noting this only occurs on a live send--sample emails, even of the segmented versions, show correct.

What it should look like
The default version
The dynamic version
Screen Shot 2019-03-10 at 3.15.21 PM.pngScreen Shot 2019-03-10 at 3.15.45 PM.pngScreen Shot 2019-03-10 at 3.15.34 PM.png

I've asked support but they aren't particularly helpful as it involves custom code (even though I believe this is an issue with rendering and not the code). Here's the full template code: [HTML] Marketo Email Template - Dynamic Content Issue - Pastebin.com

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Dynamic content removes inline styling?

It's a known limitation that variables don't work in dynamic content.

View solution in original post

3 REPLIES 3
SanfordWhiteman
Level 10 - Community Moderator

Re: Dynamic content removes inline styling?

I think you'll find that the actual problem is your variable value is not interpolated when you switch to Dynamic Content.

So the name of the variable is output instead (font-family: ${whatever}).

This in turn raises the suspicions of the mail client, which strips all the inline styles on that element before rendering. The HTML source of the received email still has all the styles, save for the one using your mktoVariable, but the mail reader (Gmail for example) strips the styles.

The raw source:

pastedImage_0.png

The stripped source in Gmail:

pastedImage_1.png

Also remember to check in multiple mail clients, because rendering differences can show you the exact cause. You can't rely only on the stripped + rendered view in a single client.

Matt_Stone2
Level 9

Re: Dynamic content removes inline styling?

Sanford Whiteman Thanks -- this makes sense. You're saying that for whatever reason, when dynamic content is added something is failing to convert the Marketo variables prior to send, which results in the literal inclusion of the variable name, instead of the intended text? And as a security precaution, Gmail strips out all the inline styling, which results in the bad render.

Is this a known limitation -- or would this be considered a bug?

SanfordWhiteman
Level 10 - Community Moderator

Re: Dynamic content removes inline styling?

It's a known limitation that variables don't work in dynamic content.