Include recipients name in outbound notifications?

Eric103
Tera Contributor

Is there a way to include the name of an email recipient if it is going to multiple people in a single notification script?

For example, if a notification is going to Jane and John, I want John get an email that includes "Dear John" and Jane get and email that includes "Dear Jane" without needing to create multiple notifications.

This is all assuming they are users in the system of course.

 

Thanks for any help!

4 REPLIES 4

harishdasari
Tera Guru

Hi Eric,

Yes you can do it by using the Email notification script.

please see this example given by servicenow how to write the script.

https://docs.servicenow.com/bundle/london-servicenow-platform/page/script/server-scripting/reference/r_ExScptEmlNtfn.html

after writing the script now simply just call the script in notification like this Dear ${mail_script:script name}

Thank you.

 

Tim Grindlay
Kilo Sage

I have the same question. I would assume that because it's a single notification, you can't do it. You'd either have to script individual notifications, which is a pain and inefficient, or have some kind of dynamic reference in the html that points to whoever is opening it.

Community Alums
Not applicable
Sure, you just need to use variable such {contact.first_name}. What is the table name that you want to set up notifications?

Hi, 

Maybe I need to rephrase - one email with multiple recipients. i.e.

To: Meg Griffin, Peter Griffin, Bryan Griffin

Subject: Request

Message: Hi Meg, ...

 

But for Peter and Bryan it would say Hi Peter, or Hi Bryan. When you setup the notification it's easy, as you say for example {contact.first_name}, as long as there is an individual email for each recipient, but I don't think it's possible with multiple. Easier to just go with a generic 'Hi'.