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
06-18-2025 12:30 AM
Static translations for notifications in ServiceNow do not apply to text generated by email scripts. When using email scripts to include dynamic content, the output will be in the default language of the instance, regardless of the user's preferred language or any configured static translations for the notification. This is because email scripts are processed after the static translation logic, so the translated content is not available at the time the script executes.