- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2025 01:16 AM
When the current caller id email ends with "@gmailusa.com", I need to send the notification to "USA tower" additionally. I wrote the email notification script as mentioned below but it's not working.
Solved! Go to Solution.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2025 01:20 AM
Hello @Mahalakshmi Rav
I don't think you can modify the "TO" for any email notification using email script, you can modify "CC" and "BCC".
I had also tried this sometime back, I don't think this works. Try changing it to "CC" and see once, if the mail script is correct - with all the fields correct - it will definitely work. Else you might need to debug script.
Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket.
Regards,
Shivalika
My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194
My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2025 01:20 AM
Hello @Mahalakshmi Rav
I don't think you can modify the "TO" for any email notification using email script, you can modify "CC" and "BCC".
I had also tried this sometime back, I don't think this works. Try changing it to "CC" and see once, if the mail script is correct - with all the fields correct - it will definitely work. Else you might need to debug script.
Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket.
Regards,
Shivalika
My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194
My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2025 01:27 AM
Thanks @Shivalika for your suggestion, I tried changing to cc but still it's not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2025 01:52 AM
Hello @Mahalakshmi Rav
In that case, go simple, use below mail script
var gr = new GlideRecord("sys_user");
gr.addQuery('sys_id', current.caller_id.sys_id);
gr.query();
if(gr.next())
{
var callerEmail = gr.getValue('email').toString();
if(callerEmail.endsWith("@gmailusa.com"))
{
email.addAddress("cc", "usatower@gmail.com", "USA Tower");
}
}
Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket.
Regards,
Shivalika
My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194
My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2025 01:55 AM
Also @Mahalakshmi Rav
Remove the display value, just keep the email in CC
Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket.
Regards,
Shivalika
My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194
My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY
