Notification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2025 10:14 PM
when sending a notification with a pdf the pdf should be attached to the notification so that the user receive it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2025 10:28 PM
so you want to attach PDF to record and then send email and that email should have attachment?
If yes then do this
1) you should check this link on how to add PDF to record via after update business rule, business rule should have correct notification trigger condition
Generate PDF and attach to the record
2) then use gs.eventQueue() to trigger the event and associate this event with notification
3) in the notification ensure "Include attachments" is checked
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2025 10:32 PM - edited 04-03-2025 10:52 PM
Hello @komalkp ,
Please use the following code instead. It takes care of generating the PDF and attaching it at the same time.
Adjust the content of "html" as per your requirements.
var v = new sn_pdfgeneratorutils.PDFGenerationAPI;
var pdfName = "Incident_" + current.number + ".pdf";
var html = current.getValue('short_description');
var result = v.convertToPDF(html, "incident", current.getUniqueValue(), pdfName);
You can learn more about this PDF API here.
Regards,
Robert