Unwanted encoding of custom fields | Community
Skip to main content
August 24, 2016
Solved

Unwanted encoding of custom fields

  • August 24, 2016
  • 4 replies
  • 4354 views

We have a custom text field that holds html containing list items and links:

<li><a href='marketing.mamsoft.co.uk/v8-certified/certificate/beru.pdf'>Beru certificate</a></li><li><a href='marketing.mamsoft.co.uk/v8-certified/certificate/champion.pdf'>Champion certificate</a></li><li><a href='marketing.mamsoft.co.uk/v8-certified/certificate/duron.pdf'>Duron certificate</a></li><li><a href='marketing.mamsoft.co.uk/v8-certified/certificate/ferodo.pdf'>Ferodo certificate</a></li><li><a href='marketing.mamsoft.co.uk/v8-certified/certificate/moog.pdf'>Moog certificate</a></li><li><a href='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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Justin_Cooperm2

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

4 replies

SanfordWhiteman
New Participant
August 31, 2016

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/

Justin_Cooperm2
New Participant
August 31, 2016

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

SanfordWhiteman
New Participant
August 31, 2016
Justin_Cooperm2
Justin_Cooperm2Accepted solution
New Participant
August 31, 2016

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

Jenn_DiMaria2
New Participant
August 31, 2016

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.

SanfordWhiteman
New Participant
August 24, 2016

Do you also have it disabled ​at the field level?