Email address of current logged in user not populated in CC field of Email from toggle bar

Nisha30
Kilo Sage

Hello Community,

We have 

Email Client Template - for sc_request

and want to have cc field populated with current logged in user. Have mail script created but cc field is not populated.

I tried running in Fix script it gives email address totally correct but somehow not working in Email.

Can you suggest what I am doing wrong here please.

Here is snap shot of mail script and Email client template.

 

1 ACCEPTED SOLUTION

Mark Manders
Mega Patron

You don't need an email script. You can just add this in the CC field of the Email Client Template: 

 

 

javascript: (function() {
  var user = new GlideRecord('sys_user');
  user.get(gs.getUserID()); // Retrieves the current user's record
  return user.email; // Returns the current user's email address
})()

 

 


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

View solution in original post

2 REPLIES 2

Mark Manders
Mega Patron

You don't need an email script. You can just add this in the CC field of the Email Client Template: 

 

 

javascript: (function() {
  var user = new GlideRecord('sys_user');
  user.get(gs.getUserID()); // Retrieves the current user's record
  return user.email; // Returns the current user's email address
})()

 

 


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Not sure why it keeps setting the first part wrong. That should just be [ javascript: (function....] and not ":"


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark