How to send email notification to different recepient based on condition which triggers by WF event?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2023 06:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-24-2023 07:14 AM
Hello @ads ,
You can use Param1 scripting field to send recipients as paramters and then check "event parm1 contains recipient" check box in who will receive tab in notification
(function() {
if(current.variables.your_variable_name=="yes")
{
return current.variables.requested_for_variable_name; // replace requested for variable name
}
else{
var arr =[];
arr.push(current.variables.requested_for_variable_name); // replace requested for variable name
arr.push("abc@email.com");
return arr.toString();
}
}());
Hope this helps
Mark my answer correct if this helps you
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2023 03:21 AM
Hi @Mohith Devatte ,
The above script is not working, Can you please let me know one thing if I want to send the notification to the eamil id only, how to write that script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2023 03:27 AM
hello @ads ,
if that user having the email ID is present in the system try glide recording to user table and get the sys_id of the user and then return it
var gr = new GlideRecord('sys_user');
gr.addQuery('email','your_email_id');
gr.query();
if(gr.next())
{
return gr.sys_id.toString();
}
Mark the answer correct if this helps you
Thanks