How to add an attachemt to Email Body
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2023 11:48 PM - edited ‎09-21-2023 12:20 AM
Hi all,
I have to add an attachment file to the email body, generating the attachment using the custom action was completed, now i need to add this attachment to email body.
I already designed a flow for adding the attachment to email body, but i'm not able to get attachment in the email body, i'm able to get the sys id of the attachment.
Thanks and Regards
Yaswanth Pandiri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2023 01:41 AM
Hi @yaswanth123
Try using the below script:
// Get the GlideEmailOutbound object
var email = new GlideEmailOutbound();
// Set the email subject and body
email.setSubject('Your Email Subject');
email.setBody('Your Email Body');
// Attach the file to the email
var attachmentSysID = 'SYS_ID_OF_ATTACHED_FILE'; // Replace with the actual sys_id of the attached file
email.addAttachment(attachmentSysID);
// Get the recipient's email address (you should have collected this earlier)
var recipientEmail = 'recipient@example.com';
// Send the email
email.send(recipientEmail);
Hope it helps you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2023 01:58 AM
Can you Share the flow You have Designed?
