character issue in From field when using token | Community
Skip to main content
Kevin_Stinson
Level 3
April 27, 2020
Question

character issue in From field when using token

  • April 27, 2020
  • 1 reply
  • 4173 views

Hello I am having and issue with adding a token to the from field.
The names I am using contains special characters: ö ä û etc

The tokens work in the body of the email but not the "From" field.

In the database I have tried switching the characters to from ö to ö and %C3 %B6 but with the same result not displaying the correct character.
See image:

 

In field management "HTML Encode Tokens in Emails" is checked.

thanks for any help getting these to display correctly,

Kevin.

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

1 reply

SanfordWhiteman
Level 10
April 27, 2020

You need Q-encoding here, HTML encoding has no significance in headers.

 

Because it's a token, you'll need Velocity to encode it.

 

I can provide the code shortly but in the meantime pls read about Q-encoding in my posts.

Kevin_Stinson
Level 3
April 27, 2020

Are you saying you can't use a regular token here if a name has special characters?

{{lead.external_fullname:default=Sales XYZ Company}}

I have about 20 sales guys for this region with various special characters.

SanfordWhiteman
Level 10
April 27, 2020

Are you saying you can't use a regular token here if a name has special characters?

{{lead.external_fullname:default=Sales XYZ Company}}

I have about 20 sales guys for this region with various special characters.


You can use a regular {{lead.token}} directly even if the value has non-ASCII (let's not say "special," that's too vague) characters. Marketo will automatically Q-encode it. But not if you also have HTML Encode Tokens in Emails checked.

 

If you have HTML Encode checked then the value is HTML-encoded everywhere, including in the headers where it is inappropriate, as well as in the Text part of emails where it's also wrong.

 

If you need the same value to be used in Q-encoded, unencoded and HTML-encoded forms, then you can't have HTML Encode on. You need the checkbox off (that means it'll work in headers and in Text) and then you need Velocity to HTML-encode it when used in the HTML part.

 

Or you could have a separate field and keep the values in sync, one checked and one unchecked, though obvs. this is tough to scale if you have lots of fields that need to be output in both formats.