SOLVED

Re: How to utilize tokens for email translations?

Go to solution
Alex_Gladding
Level 2

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. 

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: How to utilize tokens for email translations?

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

View solution in original post

14 REPLIES 14
SanfordWhiteman
Level 10 - Community Moderator

Re: How to utilize tokens for email translations?

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

Re: How to utilize tokens for email translations?

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

Re: How to utilize tokens for email translations?

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. 

 

pastedImage_1.png

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

pastedImage_2.png

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

SanfordWhiteman
Level 10 - Community Moderator

Re: How to utilize tokens for email translations?

That's right!

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

Alex_Gladding
Level 2

Re: How to utilize tokens for email translations?

Thanks Sanford! 

Its currently not working for me, but I believe its probably a referencing issue within the email itself. When you say "include both tokens in your email, with the translations map coming first", can you give me an example of what that would look like in the subject line?

Currently I just have {{my.subjectLine}} by itself in the subject line. Where and how to I add the translation map reference?

SanfordWhiteman
Level 10 - Community Moderator

Re: How to utilize tokens for email translations?

Currently I just have {{my.subjectLine}} by itself in the subject line. Where and how to I add the translation map reference?

Right before it.

Alex_Gladding
Level 2

Re: How to utilize tokens for email translations?

Like this? 

{{my.translatedText:default=edit me}}{{my.subjectLine:default=edit me}}

It returns the content of the email script:

pastedImage_1.png

SanfordWhiteman
Level 10 - Community Moderator

Re: How to utilize tokens for email translations?

{{my.translatedText:default=edit me}}{{my.subjectLine:default=edit me}}

Almost, but not with the defaults, those do not work with Velocity tokens:

   {{my.translatedText}}{{my.subjectLine}}


pastedImage_1.png

Make sure:

  • you're previewing by List (preferred) or Lead, not Default
  • you've checked the checkbox for the Country field in Script Editor for the {{my.translatedText}} token (you don't have to check it for both tokens, just the first)
Alex_Gladding
Level 2

Re: How to utilize tokens for email translations?

Worked!!! I just needed to check the Country field. This is awesome

Thanks so much for your help, Sanford!