python-o365
python-o365 copied to clipboard
Creating a draft with a message without sending
Hi there,
I want to created reply draft, this way I can manually check if my system created the correct replies before sending.
I thought this would be possible as follows:
mailbox = account.mailbox()
m = mailbox.get_message('AAMkAGFjM2UyNjAwLTIyOWEtNGZlNi1hNDQ5LTVhYjhlYzhkMTAyYQBGAAAAAABe2tXWSxOYT7LtthAmyM_PBwDcO137eY0tRZUUB1nqJ9KZAAAAAAEJAADcO137eY0tRZUUB1nqJ9KZAABq4RTHAAA=?')
reply_m = m.reply()
reply_m.body = 'This is a reply'
data = {'body': {
'content': reply_m.body}}
url = reply_m.build_url(
reply_m._endpoints.get('get_message').format(id=reply_m.object_id))
reply_m.con.patch(url, data=data)
It kind of works. However, the results draft displays the raw html instead of an actual message:

Anyone know how this is possible and a possible solution?