- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2016 09:43 AM
I'm trying to figure out how to create an Incident-related Email Client Template which, when used via the email icon/envelope, will depict the name (or userid) of the person who sent the email, and retain that information in the subsequent Activity Detail. I've found a solution here on the community where someone put ${sys_created_by} in the subject line, but that simply presents the userid of the person who created the Incident ticket, and not the person who clicked the email icon/envelope to send the email.
I've also found that I can put the following in the From field of the Email Client Template:
javascript:gs.getUserDisplayName()
Afterward, when I click the email icon/envelope, it will display my name in that field, as expected.
However when I put that same javascript in the CC or BCC fields, it does not show anything at all (other than the default "Add Address"). I don't understand why that same javascript would not work in those two fields.
Ideally I'd like to leave the default From value alone and not use the javascript in that field (so the name and address of our Servicenow system appears), so when the recipient replies to the email, it will update the applicable incident ticket.
Ideally I'd like to have the name of the person who clicked the email icon/envelope appear in the CC or BCC fields, or in the Subject line behind text such as "Email from xxxxx re: ${number}, or in the body of the email itself via mail script, for example.
Any ideas how I'd accomplish this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2016 12:34 PM
Sorry for being not clear enough. But this is how I was thinking to get it together.
With Client template you can set up how the email client will look like when you press the "email button". out the box you can put in field names in for example bcc, set how the subject should be default etc.
I hadn't tested this before, so I thought that you had to create a mail script with the email.addAddress('cc',gs.getUser().email); and then call the mail script from the template. But I tested some and I don't need a mail script. you can do it all in the template like this:
1. Create a template for the specific table. Here I create one for incident. In the example I also put the field caller_id as a CC just to show how to use that functionality. Then I have written a javascript code to fetch the logged in users mailaddress and put that one in the bcc.
And here is when I clicked on the mail icon as admin
Hope this helps you out. If you got any other questions or I got you wrong.
//Göran
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2016 12:05 PM
No problem, happy to help 😃
//Göran
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2017 05:44 AM
This solution will remove the addition of Watchlist in CC, I do not want that, can you help me out goranlundqvist ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2017 05:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2017 11:19 AM
Saw you got the correct info in that post. And like Chuck wrote, when it's fields on the form, you can just add them like I did about caller_id above as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2017 10:56 PM
If only I was more observant...
Thanks for the reply