Notification Static Translation and printing text in Email Scripts does not together
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2025 03:53 AM
Hi Community,
We are using Static Translation of Notification to translate outgoing emails into multiple languages.
In the Notifications we would like to use Email Script to Print dynamic text based on certain criteria's. This message is always printed in the default language, and not translated. Even using gs.getMessage() does not work (guessing because the way of how Static Translation works, kicking in after the outgoing email is created).
What alternatives are you using? What is best practice?
Example of printing text in Email Script
if (current.opened_by == current.contact) {
template.print(gs.getMessage("We received your case and it is created in our tracking system. Please find below details of your case:"));
} else if (current.opened_by == current.partner_contact && current.partner_contact){
template.print(current.partner_contact.getDisplayValue() + " " + gs.getMessage("have created a case on your behalf. Please find below details of your case:"));
}
else {
template.print(gs.getMessage("We have created a case on your behalf. Please find below details of your case:"));
}
I've considered:
- Splitting into multiple Notifications. This would generate a lot of Notifications (and translated version) with almost the same content, increasing the maintain burden.
- Creating translated versions of the Email Script, which also increase the maintain burden. But less than #1.
- Don't use Email script to Print text. This would lower the clarity of the message.
Looking forward to read your good ideas.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2025 04:01 AM
yes you can create notifications in respective languages and use the correct one based on recipient.
Do you have the message stored in Messages table for the other language?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2025 05:16 AM
Hi Ankur
I have a Notification "Case opened for customer", which contains a Mail script "${mail_script:case.opened.on.behalf}" that Prints text:
template.print(gs.getMessage("We have created a case on your behalf. Please find below details of your case:"));
Message exists:
But not translated:
Translated Notifications:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2025 05:37 AM
then it should work fine
check this
Return a message in a specific language, gs.getMessageLang()
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2025 12:29 AM
Got confirm from ServiceNow support that printing messages in email script only "works" together with Static Translation if you use the gs.getMessageLang(). Support has submitted an enhancement request for the documentation.
However this goes against the idea of Static Translation. If you were able to specify the language in the gs.getMessage() call, you would not need Static Translation.
The idea of Static Translation is to translate into the receiver preferred language, which A) can be different for different receivers. B) The receivers are first defined, after the message has been generated.
In short: If you use Email Script to Print and utilize Static Translation, you need an Email Script per language.