The Zurich release has arrived! Interested in new features and functionalities? Click here for more

regarding email notification

shreya_3009
ServiceNow Employee
ServiceNow Employee

i should an approval table in an email notification, so i written a email script and added to email notification.When i am checking in preview notification the approval table is visible but after submitting the request and when i check in system logs>email>preview email i am unable to see that table.
Could you pls help me out.

 

2 REPLIES 2

KrishnaMohan
Giga Sage

@shreya_3009  could you share script.

(function runMailScript(current, template, email, email_action, event) {

var approvalGr = new GlideRecord('sysapproval_approver');
approvalGr.addQuery('sysapproval', current.sys_id);
approvalGr.orderBy('sys_created_on');
approvalGr.query();
if (approvalGr.hasNext()) {
template.print("Approval History:<br/>");
template.print("<table border='1' cellpadding='15' text-align='center' style='border-spacing: 0 !important;'>");
template.print("<tr><th>Approver</th><th>Status</th><th>Date of Approval</th></tr>");
}
while (approvalGr.next()) {
template.print("<tr>");
template.print("<td>");
template.print('<a href="' + gs.getProperty('glide.servlet.uri') +
'sn_lg_ops_RedirectionPageForLCCEmailNotif.do?sys_id=' + approvalGr.sys_id + '">' +
approvalGr.approver.getDisplayValue() + '</a>');
template.print("</td>");

template.print("<td>");
template.print(approvalGr.state.getDisplayValue());
template.print("</td>");
template.print("<td>");
template.print(approvalGr.sys_updated_on.getDisplayValue());
template.print("</td>");
template.print("</tr>");
}
template.print("</table>");
}

)(current, template, email, email_action, event);
pls consider this as urgency and help if possible.thankyou