The CreatorCon Call for Content is officially open! Get started here.

how to add individuals name in email notification?

bala_1312
Tera Contributor

i am sending email notification to multiple people , but in email body i need to write like below -

 

Hello  {name of each individuals} ,

 

A request has been submitted.

 

 

i am trying below scripts but its printing everyones name.

 

var getdata = [];
getdata =current.variables.{variables_name};
var gr = new GlideRecord("sys_user");
gr.addEncodedQuery('sys_idIN' + getdata );
gr.query();
while(gr.next()) {
var name= gr.first_name;
template.print(name);
}

 

how to add individuals name there in email body , please advice .

Thank you.

5 REPLIES 5

Muhammad Khan
Mega Sage

Below link might help you.

Use recipient's name in Email Notification 

@Muhammad Khan ,

i checked the link provied by you  but can you 

please share the email script to put the {user name } in hello {first_name}, which is the user who presnt in "to" section .

Ratnakar7
Mega Sage

Hi @bala_1312 ,

 

You can use placeholders(Hi ${requested_for.name}) like below:

Ratnakar7_0-1674130125853.png

 

If you are trying to send email to all users that you are capturing in catalog variable, then you need to create an event and create the notification on event trigger, from the catalog workflow's run-script activity you can call that event multiple times with looping & passing each array value from list of user variable.

 

Thanks,

Ratnakar

 

Hi @Ratnakar7 ,

 

i need email recipient name in email body .