SOLVED

Unwanted encoding of custom fields

Go to solution
Anonymous
Not applicable

Unwanted encoding of custom fields

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:

pastedImage_0.png

However, when viewing the online version in a browser, the html is encoded and the field displays as text:

pastedImage_2.png

Viewing the browser source indicates that the field content has been encoded:

pastedImage_4.png

How do we disable the encoding and get the online version to render correctly? We have not enabled encoding of tokens.

pastedImage_5.png

1 ACCEPTED SOLUTION

Accepted Solutions
Justin_Cooperm2
Level 10

Re: Unwanted encoding of custom fields

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

View solution in original post

12 REPLIES 12
SanfordWhiteman
Level 10 - Community Moderator

Re: Unwanted encoding of custom fields

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

Jenn_DiMaria2
Level 10

Re: Unwanted encoding of custom fields

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.

Justin_Cooperm2
Level 10

Re: Unwanted encoding of custom fields

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

SanfordWhiteman
Level 10 - Community Moderator

Re: Unwanted encoding of custom fields

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
Level 10

Re: Unwanted encoding of custom fields

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
Level 10 - Community Moderator

Re: Unwanted encoding of custom fields

Justin_Cooperm2
Level 10

Re: Unwanted encoding of custom fields

lol I think you may be just a tad bit more advanced than our average customer

SanfordWhiteman
Level 10 - Community Moderator

Re: Unwanted encoding of custom fields

True enough, but anyone can use the service! (No one ever pays attention though.)

Jenn_DiMaria2
Level 10

Re: Unwanted encoding of custom fields

I pay attention! Your answers have been a godsend to me in many circumstances