We have a custom text field that holds html containing list items and links:
<li><a href='http://marketing.mamsoft.co.uk/v8-certified/certificate/beru.pdf'>Beru certificate</a></li><li><a href='http://marketing.mamsoft.co.uk/v8-certified/certificate/champion.pdf'>Champion certificate</a></li><li><a href='http://marketing.mamsoft.co.uk/v8-certified/certificate/duron.pdf'>Duron certificate</a></li><li><a href='http://marketing.mamsoft.co.uk/v8-certified/certificate/ferodo.pdf'>Ferodo certificate</a></li><li><a href='http://marketing.mamsoft.co.uk/v8-certified/certificate/moog.pdf'>Moog certificate</a></li><li><a href='http://marketing.mamsoft.co.uk/v8-certified/certificate/payen.pdf'>Payen certificate</a></li>
When this field is inserted into an email, it renders correctly in Gmail:
However, when viewing the online version in a browser, the html is encoded and the field displays as text:
Viewing the browser source indicates that the field content has been encoded:
How do we disable the encoding and get the online version to render correctly? We have not enabled encoding of tokens.
Solved! Go to Solution.
We literally were just talking about this in the engineering team. This happens because we have a security feature on all of our landing page infrastructure to ALWAYS html encode tokens when they are replaced on a webpage. It's not possible to override this. The setting you are looking at is only for emails. We are going to put in a change to support non-html encoding these values in the email web viewer for fields that you've specified to not be HTML encoded in your emails.
Justin
Do you also have it disabled at the field level?
Just delete the web version and all is well Kidding!
Maybe try recreating the field as a string? If you're hard coding it anyway, it's worth a try. I know the rich text editor in email does some weird encoding things on the text version of emails, so maybe this is something similar.
We literally were just talking about this in the engineering team. This happens because we have a security feature on all of our landing page infrastructure to ALWAYS html encode tokens when they are replaced on a webpage. It's not possible to override this. The setting you are looking at is only for emails. We are going to put in a change to support non-html encoding these values in the email web viewer for fields that you've specified to not be HTML encoded in your emails.
Justin
I've found this very easy to work around. Wrap tokens in containers with an easily findable class. Then
[].forEach.call(document.querySelectorAll('.encodedHTML'),function(el){
el.innerHTML = el.textContent;
});
Live demo: http://codepen.io/figureone/pen/4444c0f427cff2f579f3b0a55a2536f7/
You add that to your emails tho? wouldn't that hurt your deliverability and sender reputation since you have JS in there? I'm talking about when a user clicks "View as webpage" in a marketo email
I add it to my custom View As Web Page endpoint.
lol I think you may be just a tad bit more advanced than our average customer
True enough, but anyone can use the service! (No one ever pays attention though.)
I pay attention! Your answers have been a godsend to me in many circumstances