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.
Solved! Go to Solution.
In a nutshell:
#set( $translatedText = {
"subjectLine" : {
"en-us" : "... something...",
"es-mx" : "... algo... "
},
"footerText" : {
"en-us" : "... something...",
"es-mx" : "... algo... "
}
} )
${translatedText["subjectLine"][$lead.PreferredLanguage]}
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?
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.
That's right!
You simply include both tokens in your email, with the translations map coming first.
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?
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.
Like this?
{{my.translatedText:default=edit me}}{{my.subjectLine:default=edit me}}
It returns the content of the email script:
{{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}}
Make sure:
Worked!!! I just needed to check the Country field. This is awesome
Thanks so much for your help, Sanford!
Great!
Hey @SanfordWhiteman, we are wanting to use a similar approach, but how would we structure the "translatedText" token if we're wanting to use a "contains" instead of "is" for our language field? We use "lead.browserLanguage" as our way of defining which language they get and they contain things like "es-LA" or "es-Pt", etc. So in that case I'd want the map to say something like "if contains "es" then: [Spanish translation]
Sounds like startsWith, not contains! Otherwise a lot of confusion will ensue.
The token with the translations would be structured the same. The token that finds the current translation couldn't just grab the matching property, though. It has to loop (#foreach) over the entries and then use startsWith.
First of all, this topic is amazing! This community can't thank @SanfordWhiteman enough!
I've been playing with this for some time and stumble upon one problem. I have a CTAText and CTAURL that's translated but Marketo doesn't track it. However, when I have an URL with <a> tag in the velocity script, it does track it. The problem is that in our email designs, a-tags often include inline styling and we definitely don't want that in our velocity script.
Anyone ideas?
No idea here. (See also - if you haven't already - https://nation.marketo.com/t5/product-discussions/velocity-script-a-trackable-url/td-p/164640)
I had built a 30 email trial nurture in 6 languages completely in Velocity once, and it was okay, but eventually I'd not do it again. Next time I'd go traditionally with Snippets and Segmentations.
In a nutshell:
#set( $translatedText = {
"subjectLine" : {
"en-us" : "... something...",
"es-mx" : "... algo... "
},
"footerText" : {
"en-us" : "... something...",
"es-mx" : "... algo... "
}
} )
${translatedText["subjectLine"][$lead.PreferredLanguage]}