Email notifications

Jo_o Luis
Tera Contributor

How do I get the recipient_groups on the HTML message of the email?

Jo_oLuis_0-1697804175755.png

 

3 ACCEPTED SOLUTIONS

Dipen Wadhwana
Giga Guru

Hi @Jo_o Luis ,

 

Write a mail script and you can use the below script to print recipient_groups.

template.print(email_action.recipient_groups.getDisplayValue());

 Please mark my answer helpful if it helped you.

Thanks

View solution in original post

Mohan Mallapu
Kilo Sage

@Jo_o Luis 
We can get it by using email script.
Email script :

template.print(email_action.recipient_groups.getDisplayValue());  // print the group names.

in Email Content: 
${mail_script:emailScriptName}

Please mark my answer as correct based on Impact.

View solution in original post

@Jo_o Luis Instead of mapping the variable using Message HTML, you need to use a mail script to fetch the name of group.

 

Here is the link to mail script documentation https://docs.servicenow.com/bundle/tokyo-servicenow-platform/page/script/server-scripting/concept/c_...

 

Inside the email script you can user the following code.

 

template.print('Dear '+email_action.recipient_groups.getDisplayValue());

Hope this helps.

 

View solution in original post

8 REPLIES 8

I´m trying to get the 'recipient_groups' value on the message html as you can see on the screenshots

 

Jo_oLuis_1-1697811181467.png

 

Jo_oLuis_0-1697811136862.png

 

@Jo_o Luis Instead of mapping the variable using Message HTML, you need to use a mail script to fetch the name of group.

 

Here is the link to mail script documentation https://docs.servicenow.com/bundle/tokyo-servicenow-platform/page/script/server-scripting/concept/c_...

 

Inside the email script you can user the following code.

 

template.print('Dear '+email_action.recipient_groups.getDisplayValue());

Hope this helps.

 

Mohan Mallapu
Kilo Sage

@Jo_o Luis 
We can get it by using email script.
Email script :

template.print(email_action.recipient_groups.getDisplayValue());  // print the group names.

in Email Content: 
${mail_script:emailScriptName}

Please mark my answer as correct based on Impact.

Mohan Mallapu
Kilo Sage

@Jo_o Luis  

Hope i have answered your question , If yes, Please mark my answer as correct and close this tread.

Thank you