How can I dynamically adapt the From & Reply To in email client templates ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hello Community!
I need your help regarding email client templates.
I need the From & Reply To to dynamically change based on some conditions.
For example, if my contacted desk field is techsupport@xxx.com - > From & Reply To should be 'Tech Support' <techsupport@xxx.com>
How can I achieve this in the email client templates ? I 5 use cases
I tried with scripted on the from but I don't get the expected results.
(function(fromAddressQuery, targetRecord) {
util = new BEL_Util();
from = util.getServiceDeskForClient();
var source = "BEL UTIL CLIENT EMAIL : ";
var regex = /<([^>]+)>$/;
var emailAddress = [];
emailAddress = from.match(regex);
fromAddressQuery.addQuery('email_address', emailAddress[1]);
gs.log(source + ' email address compiled : ' + emailAddress);
})(fromAddressQuery, targetRecord);
Can someone help me out ?
Thanks
Jérôme
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi @JérômeM
You can update your script/script include by these kind of logic:
if (current.contacted_desk == 'techsupport@xxx.com')
{
emailAddress = 'Tech Support <techsupport@xxx.com>';
}
else if (current.contacted_desk == 'billing@xxx.com')
{
emailAddress= 'Billing Department <billing@xxx.com>';
} else {
emailAddress = 'Service Desk <support@xxx.com>';
}
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti