- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2020 06:09 AM
Hi,
I have a requirement to set email from address dynamically while a user is sending quick mails from a certain form.
Eg, We have a case form from where user is sending a mail. Depending upon the country of the user the email from address needs to be set.
I have gone to Email Client Templates, selected a template, went to sender configuration, changed From generation type to - Script. There I can see a 'script for from' section. I would like to know of the parameters this script section takes and how it returns the email address. Any sample code would also do. Thanks,
Thanks,
Avik
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2020 05:45 AM
@Avik
Hope you are doing good.
Let me know if I have answered your question.
If so, please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.
If not, please let us know if you need some more assistance.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2020 06:19 AM
Hi,
try this
var userRec = gs.getUserID();
var rec = new GlideRecord('sys_user');
rec.get(userRec);
if(rec.country.name == 'India'){
answer = 'your email id';
}
else{
answer = 'your another email id';
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2020 05:45 AM
@Avik
Hope you are doing good.
Let me know if I have answered your question.
If so, please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.
If not, please let us know if you need some more assistance.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2025 10:25 PM
Old post but it looks like the script expects you to return a record from the