Add attachment to Notification Email
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2016 08:27 AM
I've created a Service Catalog Request which will have an attachment included. Is there a way to include that attachment to Notification Email?
Thanks,
Sarah
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-12-2018 08:20 AM
I can't believe this worked like a charm - just applied the code as stated here!
Can't thank you enough 🙂
Regards,
Sonal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2016 10:26 AM
Also keep in mind there is a "Attachment" checkbox on the notification record which will copy any attachments from the "current" record that the email fired on, so if your email is configured on the sc_req_item table and the attachment is on the same table, the attachment will be copied into the email.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-18-2016 04:59 AM
Hi there!
I kind of have the same question and unfortunately for some reason I can't seem to find it working
(currently on Geneva)
In Managed Documents, when I create a New Document & add a Document Revision with an attached document for revision,
I want it send the Approval Revision Request to my email with the attachment included in the email...
What i get so far in the email is:
"Click to approve" (works)
"Click to reject" (works)
"Click here to view Approval Request" (works)
"Click here to view Document Revision" (works)
While it maybe seems no so important to include the attachment in the email body itself, it would be nice if i can get this working=)
What I've tried so far is adding the above email notification script (in different ways) and I also checked the box "include attachments" in the "Document Revision Approval Request" Notification & even the "Approval Request" Notification..
Someone who might know the answer?
Thanks a lot!
Chris

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2019 09:00 AM
I got around the issue of attachments link not working for non roled users by
creating a knowledge article and adding an attachment to it,
publishing it,
then referencing its attachment from the email notification script
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
var url='/sys_attachment.do?sys_id=1d9ab0f31b5db300cee5ed7cee4bcb08&sysparm_viewer_table=kb_knowledge&sysparm_viewer_id=497a30f31b5db300cee5ed7cee4bcb81'; //--had to add the attachment to a KB article in order to be able to allow non-roled users to access the attachment
template.print ('<a href="' + url + '">Click to download the floor plan</a>');
})(current, template, email, email_action, event);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2024 02:07 AM
Yes, you can include attachments in the notification email from a Service Catalog Request. However, it requires scripting and customization. Here are the steps:
1. Create a new Inbound Email Action (System Policy > Email > Inbound Actions).
2. Set the conditions to match your requirements.
3. In the Script field, use the following script:
javascript
(function runAction(/* GlideRecord */ current, /* GlideRecord */ event, /* email_action */ email_action, /* SC_Email */ email, /* GlideRecord */ email_action_instance) {
// Get the sys_id of the attachment
var attachment = new GlideRecord('sys_attachment');
attachment.addQuery('table_sys_id', current.sys_id);
attachment.query();
if (attachment.next()) {
// Add the attachment to the email
email.addPart(event, attachment);
}
})(current, event, email_action, email, email_action_instance);
4. Save the Inbound Email Action.
5. Now, when a Service Catalog Request is created with an attachment, the attachment will be included in the notification email.
Please note that this is a customization and may require additional testing and validation to ensure it works as expected in your environment. Also, be aware that large attachments may cause issues with email size limits.
nowKB.com
If you want to know any information about Service Now . Visit to https://nowkb.com/home