How to add the image content from sys_attachment in email template.

cloudboy
ServiceNow Employee
ServiceNow Employee

 

I want to embed an image in email template from sys_attachment table, as I have added the attachment in change_request table and when i open form view and click View attachment below URL is shown with corresponding image, but as i need to embed this image in email template so user can see image content

in email, there is no option for taking images from sys_attachment table only the images from db_image_list is shown.

https://myInstance.service-now.com/sys_attachment.do?sysparm_referring_url=tear_off&view=true&sys_id...XX

Let me know how to get the absolute path of the images from sys_attachment , or any other way to copy this image in db_image_list ?

 

Thanks!

 

 

 

 

1 ACCEPTED SOLUTION

Deepak Ingale1
Mega Sage

Hi CloudBoy,

 

You can use email script to get base64 of the attachment and put those base64 attachment content in email body using template.print()

If you want to copy sys_attachment attachment to db_image table, you can first download the sys_attachment image file, once done you can upload it to db_image table using below link

 

https://docs.servicenow.com/bundle/geneva-servicenow-platform/page/administer/navigation_and_ui/conc...

 

Note: Please mark reply as correct if it has answered your question OR mark it as helpful if it has created an impact towards getting a solution

View solution in original post

2 REPLIES 2

Deepak Ingale1
Mega Sage

Hi CloudBoy,

 

You can use email script to get base64 of the attachment and put those base64 attachment content in email body using template.print()

If you want to copy sys_attachment attachment to db_image table, you can first download the sys_attachment image file, once done you can upload it to db_image table using below link

 

https://docs.servicenow.com/bundle/geneva-servicenow-platform/page/administer/navigation_and_ui/conc...

 

Note: Please mark reply as correct if it has answered your question OR mark it as helpful if it has created an impact towards getting a solution

Thanks Deepak. It works.