- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-30-2024 07:28 PM
Hellow My friends
I have a demand now,I needed to send a email to Teams channels, this email Include picture where is in Attachment[sys_attachment] Table.
I had try base64,and cid two ways but all fall, I can't see the picture .Do attachments need to be added to the email and sent together.
Or there is some other ways
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-30-2024 07:57 PM
Hi @haoranhuang ,
Is your picture attached to demand record or you need to send common picture in every email.
If attachments are in record then use below configuration.
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-30-2024 10:17 PM
To send an email with an embedded image from the sys_attachment table to a Microsoft Teams channel, the image must be properly attached to the email and referenced in the email body. The recommended approach is to retrieve the image from the sys_attachment table using a GlideSysAttachment object, add it to the email as an attachment, and then reference it using a unique Content-ID (cid) in the HTML body of the email. This ensures that the image is embedded properly and appears in the email.
If the cid approach does not work due to limitations in Teams, another option is to host the image on an accessible URL and include the URL in the src attribute of the img tag in the email. Alternatively, you can encode the image in base64 and embed it directly in the email using the data: URI scheme. However, base64 encoding can significantly increase the email size.
Here’s a brief script overview: retrieve the image data using the image's sys_id, attach it to the email, and use the cid in the HTML body to embed it. Make sure to test the email thoroughly, as some email clients may not fully support cid embedding. Hosting the image on a public URL is often a more reliable fallback if embedding issues persist.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-30-2024 07:57 PM
Hi @haoranhuang ,
Is your picture attached to demand record or you need to send common picture in every email.
If attachments are in record then use below configuration.
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-01-2025 06:21 PM
Thank you
but i still want to use the send email action to send email
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-30-2024 10:17 PM
To send an email with an embedded image from the sys_attachment table to a Microsoft Teams channel, the image must be properly attached to the email and referenced in the email body. The recommended approach is to retrieve the image from the sys_attachment table using a GlideSysAttachment object, add it to the email as an attachment, and then reference it using a unique Content-ID (cid) in the HTML body of the email. This ensures that the image is embedded properly and appears in the email.
If the cid approach does not work due to limitations in Teams, another option is to host the image on an accessible URL and include the URL in the src attribute of the img tag in the email. Alternatively, you can encode the image in base64 and embed it directly in the email using the data: URI scheme. However, base64 encoding can significantly increase the email size.
Here’s a brief script overview: retrieve the image data using the image's sys_id, attach it to the email, and use the cid in the HTML body to embed it. Make sure to test the email thoroughly, as some email clients may not fully support cid embedding. Hosting the image on a public URL is often a more reliable fallback if embedding issues persist.