Sample of using script include in email notification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2017 12:30 PM
Hi everyone,
I need help with calling a script include into an email notification. I am looping over the email body and if there are mandatory variables missing in the email then a notification gets sent to the user. I am able to get the missing/mandatory variables but can not format the question neatly in the email notification. Any help would be greatly appreciated.
- Labels:
-
Customer Service Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2017 01:23 PM
If this on geneva, then the syntax for mail script is in correct. <mail_script> tags are legacy ones. You will need to create a script under notification email scripts and reference that in the actual notification as ${mail_script:script_name}
Scripting for email notifications
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-17-2017 07:26 AM
Here is my Email Script Notification:
Name is array_table
(function runMailScript(current, template, email, email_action, event) {
var a = JSON.parse(event.parm2);
var allMandatory = a.allMandatory;
var missingMandatory = a.missingMandatory;
for (var i = 0; i < allMandatory.length; i++) {
template.print(allMandatory[i]);
}
for ( i = 0; i < missingMandatory.length; i++) {
template.print(missingMandatory [i] );
}
})(current, template, email, email_action, event);
And here is my notification calling it:
${mail_script:script_array_table}
I'm getting the error: 'Email script render error: email script [ script_array_table ] does not exist'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2017 10:12 AM
James,
You are calling
${mail_script:script_array_table}
But your post says the script is named 'array_table'. Should you not be calling
${mail_script:array_table}
ps - I came here because I'm having a similar error. I'm trying to include the out-of-box script for listing attachments named 'attach_links'.
That script is in the global scope. My calling notification is in a scoped application. I don't know if that is the issue. I'm investigating now.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2017 10:15 AM
Good catch. James update your mail script tag accordingly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2017 10:24 AM
FYI, I duplicated the out-of-box attach_links as a new Email Script in our scoped application scope and renamed it u.attach_links.
Calling ${mail_script:u.attach_links} still throws an error: 'Email script render error: email script [ u.attach_links ] does not exist'.
Stumped. It definitely exists.