An API that connects multiple Microsoft services, enabling data access and automation across platforms
Graph Mail api - data-attributes are deleted when working with drafts
I'm working with Graph api to create and manage draft messages on outlook.
I'm generating an HTML body and trying to add data-attributes on an element in the body.
But when I create/update the draft, my attribute is being deleted and the draft message is saved without it.
For example, if I use:
POST https://graph.microsoft.com/v1.0/me/messages (using create message api - https://learn.microsoft.com/en-us/graph/api/user-post-messages?view=graph-rest-1.0&tabs=http)
with this body:
"body":{
"contentType":"HTML",
"content":"<div data-my-var="value"> This element has a data attribute </div>"
}
My data-my-var attribute is being deleted and the body I get in the response doesn't have it
I'm building my own email editor which is integrated with office and I don't want to lose my special attributes after creating/updating the draft on the mail provider.
Is there any way to make this work or any alternative approach?