Regarding attaching the email as an attachment

Megha-1234
Tera Contributor

Hi Team ,

 

We have a requirement to attach emails as an attachment to a record whenever new email is added to the record. Could you please suggest if we can achieve that.

 

 

1 REPLY 1

Ratnakar7
Mega Sage
Mega Sage

Hi @Megha-1234 ,

 

Yes, it's possible to achieve this requirement in ServiceNow using various methods. One approach is to use Business Rules or Scripted REST APIs to automatically attach emails as attachments to a record when a new email is added.

 

Write a Business Rule or a Scripted REST API that triggers whenever a new email is received. This script should include logic to extract the email content and attachments, and then attach them to the corresponding record.

Use scripting to parse the incoming email and extract relevant information such as subject, body, sender, and attachments. You can use GlideEmailInbound or other appropriate APIs for this purpose. 

Once you have extracted the email content and attachments, use GlideSysAttachment API to attach the email as an attachment to the designated record. Ensure that you set appropriate metadata such as file name, content type, and parent record ID.

 

Thanks,

Ratnakar