In Outlook JS Addin, need a way to match inline attachment content to contentId

In Outlook JS Addin, need a way to match inline attachment content to contentId
0

Upvotes

Upvote

 Dec 19 2023
0 Comments 
New

Hi! We built a Outlook Addin taskpane to generate the "current email" using the Outlook js Mailbox API in order to send it to our platform. We use Office.context.mailbox.getBodyAsync({coercionType: HTML}, ......) to get the body with inline attachments specified. In this format, inline attachments are identified by content ID (cid).

 

We need a way to get the attachment content id for each attachment through the js api (it is not currently available in the Office.context.mailbox.item.attachments object), in order to add the content id to that attachment in the recreated '.eml' and match the html. We would like to keep everything client side. Is there any way to do this?

 

We originally were iterating through the attachments and content ids, but they are sometimes out of order.

 

We don't want to switch to use Graph as that would be a breaking change for our customers and we would like to avoid using EWS. 

 

Thanks!

 

Other people have also run into this issue

https://github.com/OfficeDev/office-js/issues/3482

https://github.com/OfficeDev/office-js/issues/1823