Skip to main content
Alex_Gladding
Level 2
Oct 29, 2019 11:02 PM UTC
Solved

How to utilize tokens for email translations?

I have heard people mention using tokens to translate emails instead of using the "dynamic" email functionality. How do you utilize tokens to do this? I have not found any documentation / guides on this subject. 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
SanfordWhiteman
SanfordWhitemanAccepted solution
User Group Leader
Oct 29, 2019 11:16 PM UTC

In a nutshell:

  • You set up a common Velocity token with your translation map, let's call it $translatedText.. (Obvs. the linguistic part doesn't happen automatically!)
#set( $translatedText = {
"subjectLine" : {
"en-us" : "... something...",
"es-mx" : "... algo... "
},
"footerText" : {
"en-us" : "... something...",
"es-mx" : "... algo... "
}
} )‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

  • You store the lead's preferred language in a lead field, let's call it $lead.PreferredLanguage.
  • Tokens output the appropriate value from the map, like
${translatedText["subjectLine"][$lead.PreferredLanguage]}‍‍

14 replies

SanfordWhiteman
User Group Leader
SanfordWhitemanUser Group LeaderAccepted solution
User Group Leader
Oct 29, 2019 11:16 PM UTC

In a nutshell:

  • You set up a common Velocity token with your translation map, let's call it $translatedText.. (Obvs. the linguistic part doesn't happen automatically!)
#set( $translatedText = {
"subjectLine" : {
"en-us" : "... something...",
"es-mx" : "... algo... "
},
"footerText" : {
"en-us" : "... something...",
"es-mx" : "... algo... "
}
} )‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

  • You store the lead's preferred language in a lead field, let's call it $lead.PreferredLanguage.
  • Tokens output the appropriate value from the map, like
${translatedText["subjectLine"][$lead.PreferredLanguage]}‍‍
Translate
Alex_Gladding
Level 2
Oct 31, 2019 3:44 PM UTC

Hi Sanford, thanks for the detailed answer! This is very helpful. 

Just so I understand, so the translation map gets stored in an email script token name something like {{my.translatedText}}, and then the outputs would be stored in separate email script tokens named something like {{my.subjectLine}} or {{my.footerText}}?

Or does the entirety of the script get stored in a single email script token? And if so, how is the correct token referred to in the email?

Translate
Alex_Gladding
Level 2
Oct 31, 2019 4:08 PM UTC

I apologize in advanced as I am VERY new to this. This is how I have it set up right now. I have a email script token named {{my.translatedText}} that looks like the following. 

 

And then I have another email script token named {{my.subjectLine}} that looks like this...

And then I use refer to {{my.subjectLine}} within the emails subject line. 

Translate
SanfordWhiteman
User Group Leader
User Group Leader
Oct 31, 2019 5:00 PM UTC

That's right!

You simply include both tokens in your email, with the translations map coming first.

Translate