Get the user email

asher14
Tera Contributor

Hi, I'm working in the script include to get the users email. Currently it is not getting the users email and would like some help.

 

Here's the script below:

               var leadUser = vtmrGR.u_user_ref;
                var leadGR = new GlideRecord('sys_user');
                if(leadGR.get(leadUser)){
                    var leadEmail = leadGR.email;
                    email.addAddress("cc", leadEmail);
                }
5 REPLIES 5

Akif_Shah
Kilo Sage
Kilo Sage

There isn't anything wrong with the script as long as you already have the object vtmrGR defined and u_user_ref returns a sys_id of the user.
Did you check on the sys_email table that the email of the user was included? When you cc the email address, that will be displayed on the "Copied" field of the sys_email record and not on the "Recipients" field.