How to utilize tokens for email translations? | Community
Skip to main content
Alex_Gladding
October 29, 2019
Solved

How to utilize tokens for email translations?

  • October 29, 2019
  • 2 replies
  • 6442 views

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.
Best answer by SanfordWhiteman

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]}

2 replies

SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
October 29, 2019

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]}
Alex_Gladding
October 31, 2019

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?

Alex_Gladding
October 31, 2019

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. 

SanfordWhiteman
Level 10
October 31, 2019

That's right!

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