Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

How to add an attachemt to Email Body

yaswanth123
Tera Contributor

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

 

 

2 REPLIES 2

msd93
Kilo Sage

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.

SHARANsnow7
Tera Guru

Can you Share the flow You have Designed?