Populate recipients First name in the email body for a particular group

taylor13
Tera Contributor

I am trying to send an email notification to a group of users. I have a salutation in the Body of the email saying Hello "Name". How do I populate the recipients name in "Name" such that each user who receives the email gets their own name in the email salutation? 

 

@Ankur Bawiskar @Community Alums @Aman Kumar S 

1 ACCEPTED SOLUTION

Ramu Neelam
Giga Expert

Hi Taylor,

If the notification recipient is a group, then system generates only one single email and content will not be generated dynamically for each individual recipient.  However, if you are ok to have all the recipients separated by comma or slash then you can achieve this using email script:

Write an email script and get the recipient name(s) from the group and then generate a concatenate string will all the recipients separated by "/". For example, the notification group is Business_Users_Group which contains two users in it (Ramu Neelam and Taylor Joy). The email script iterates the group members and generates a string "Hello Ramu / Taylor".

Please keep in mind that ServiceNow generates single email and send it to all the group members but not multiple individual emails (separate email for each recipient). So, you can't generate email body like "Hello Ramu" for Ramu's email and "Hello Taylor" for tailor email because it is only one email where both Ramu and Taylor is copied.

 

Please let me know if you need any help with the email script.

 

Thanks,

Ramu Neelam

View solution in original post

11 REPLIES 11

Hello Sandeep,

Check below links in the email body its showing only group name but i want individual recipients name:-

 

https://INSTANCE-NAME.service-now.com/now/nav/ui/classic/params/target/sysevent_email_action.do%3Fsy...

Community Alums
Not applicable

Hi @taylor13 ,

 It shows group name because, in "Who will receive" section, you have a group name mentioned.

SandeepDutta_0-1684325913265.png

And you have "${assessor_group} on your email body, what you can try is below:

SandeepDutta_1-1684326271097.png

and:

SandeepDutta_2-1684326399511.png

 

Abhishek_Chavan
Tera Expert

If you are using flow to generate the email, you can use the data pill to refer to the user.

 

However, if you are using the notification form. you can use the fields under 'who will receive' to mark the sender.

Abhishek_Chavan_0-1684322749294.png

 

And use the variables field under 'What it will contain' section to address the user something like '${opened_by.first_name}'

 

Abhishek_Chavan_1-1684322767128.png

 

Let me know if you have any questions.

 

 

Hello ,

Thanks for your quick reply!

Actually we are providing assessment approval notification in Risk Assessment Module. as per OOTB functionality its taking only Entity Owner name. we want to send notification to Particular Group assume XYZ is a Group and we both are part of that Group. so, whenever i received the email I want message as a Hello Taylor joy, for you it will be Aman Kumar.

 

Actually I have Tried the email script trying to call out in the notifications but it's not working

Community Alums
Not applicable

Hi @taylor13 ,

While configuring your notification, under the "What it will contain" section, if you scroll down, you can find a "Fields" , just hit the "+" icon and add the fields(which is the first name for you) into your message/email body:

 

SandeepDutta_0-1684322875175.png