- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-04-2025 07:11 AM
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
‎09-04-2025 07:28 AM - edited ‎09-04-2025 07:53 AM
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
‎09-04-2025 07:32 AM
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
‎09-04-2025 10:41 PM
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
‎09-04-2025 08:33 AM
did't worked i tried this too bad luck 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-04-2025 08:39 AM
Try clearing the cache
use cache.do in the filter navigator.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-04-2025 09:34 AM
Hi @adityaverma
Here's work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-04-2025 10:36 PM
I also want the currently logged-in user's name and schedule included in the Content >> Body HTML of the email client template.
