- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday
I tried adding current logged in user in Email client template in the CC as a recepeint "javascript: gs.getUser().getEmail()" but it wont work, can anyone help me on this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday - last edited Thursday
Use below in email client template CC field,
javascript: gs.getUserDisplayName() + " <" + gs.getUser().getEmail() + ">"
If this helped to answer your query, please mark it helpful & accept the solution.
Thanks,
Bhuvan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday
Hi @adityaverma ,
Use a Client Email Template
In the CC field, enter:
javascript: gs.getUserDisplayName() + " <" + gs.getUser().getEmail() + ">"
Alternate option: Use an Email Script for More Control....
If the above doesn’t meet your needs or doesn’t work consistently, use an Email Script instead....
Create a new script with the following structure:
(function runMailScript(/* GlideRecord */ current,
/* TemplatePrinter */ template,
/* Optional EmailOutbound */ email,
/* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
email.addAddress(
'cc',
gs.getUserDisplayName() + ' <' + gs.getUser().getEmail() + '>'
);
})(current, template, email, email_action, event);
In your Notification/ Email Trigger, reference this script in the message or body with:
${mail_script:your_script_name}
If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday
I provided the correct syntax along with screenshots and sample email notification using email client template in my earlier post.
If my response helped to answer your query, please mark it helpful & accept the solution.
Thanks,
Bhuvan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday
it worked fine for me
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday
I did same but it did't worked for me CC is still empty.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday
the logged in user has email populated or not?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday - last edited Thursday
Use below in email client template CC field,
javascript: gs.getUserDisplayName() + " <" + gs.getUser().getEmail() + ">"
If this helped to answer your query, please mark it helpful & accept the solution.
Thanks,
Bhuvan