gs.getMessage() issue in email notifications

nagaraju8
Kilo Guru

Hi Guys,

I'm having my first go at an instance with multiple languages set up and having an issue with gs.getMessage() returning only English messages in notifications even though I have translated messages. I have tried logging in selecting other language and having other language set on a user record but still all I see is English messages.

Below are my translated messages.

MSG Translations.PNG

Email script name: (chubb_message)

var msg=gs.getMessage('chubb_message');

  email.setSubject(msg);

Notification: Message HTML field

Email script.PNG

Please any one suggest me on this?

Any help would be much appreciated!!

Regards,

NJ

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

Short answer: The notification processing is happening in the background as the system account. It doesn't know what language the user is unless you tell it. If you are triggering the notifications from events, you can pass one of the parameters and then use that to get the proper message.



The approach I have used in multi-lingual is less elegant, but never failed. I trigger notifications from an event (ex: gs.eventQueue('my.notification', current, '', ''))



Then I have a notification for each language and a condition that checks the recipient's language. For example, if the message is going to the incident caller. These all respond to the same event trigger, but only the one matching the proper conditions gets sent.



Notification: Incident commented - EN


Condition: Caller.Language | is | English


(English subject and body)



Notification: Incident commented - FR


Condition: Caller.Language | is | French


(French subject and body)



and so on...



http://wiki.servicenow.com/index.php?title=Events_and_Email_Notification


Email Notifications - ServiceNow Wiki


View solution in original post

16 REPLIES 16

oharel
Kilo Sage

Hi Ben-sheffer,



I tried that but no luck still I am getting English messages.


Any Idea?



Regards,


NJ


Have a look here: gs.getMessage() in email notification


Let me know if it helps.


Sorry Ben that does not helps me.


Do we have any other way to do it?



Regards,


NJ