- 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
did't worked i tried this too bad luck 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday
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
Thursday
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday
I also want the currently logged-in user's name and schedule included in the Content >> Body HTML of the email client template.