How to send notification to users in a variable?

kalyan778
Mega Guru

Hi All,

Can anyone please let me know how to send the notification to the users in variable?

Let's share my scenario

I have one variable 'x' on a variable form ,x contains 10 user id's. Now I need to send a notification to the 10 members who are there in 'x'.

Can anyone please suggest.

Thanks

19 REPLIES 19

use this in your email notification message


<mail_script>


var gr= new GlideRecord('sys_user');


gr.get(current.variables.<your variable_name>);


email.setReplyTo(gr.email.toString());


</mail_script>


You can shorten this code by dot walking.


<mail_script>


email.setReplyTo(current.variables.<your variable_name>.email.toString());


</mail_script>


I can't get the notification to trigger.   I complete the request form but no email.


Tadz
Tera Guru
Tera Guru

Hi,



Have you tried. current.variables.<variable_name>.email.


Just loop all the users and get the email.


jimpaige
Giga Contributor

The email is not on the on the request form.



In summary:   I have a two reference variables looking up names in the sys_user table.   I need these users be included in the outgoing notification email triggered when the service catalog request is submitted.



Any ideas?