Adding an attachment to an outbound notification
updated ref:
------
notifications email script - uses interim integrations attachments table
attachLinks();
function
attachLinks() {
//Check if there are attachments to be sent
var intAttach = new GlideRecord('u_task_integration_attachments');
intAttach.addQuery('u_task', current.sys_id);
intAttach.addQuery('u_vendor', gs.getProperty('zzzz.vendor.sys_id'));
intAttach.addQuery('u_send_attachment','true');
intAttach.query();
if (intAttach.hasNext()) {
template.print("Attachments:
<br />");
while (intAttach.next()) {
var attachLink = '<a href="' + gs.generateURL('sys_attachment',intAttach.u_attachment_file_sysid) + '">' + intAttach.u_attachment_file + '</a>';
template.print(attachLink + "<br
/>");
intAttach.u_send_attachment = false;
intAttach.u_attachment_sent = true;
intAttach.update();
}
template.print("<hr/>");
}
}
Comments
Post a Comment