OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
670 stars 96 forks source link

Outlook Online, outlook.com: item.body.getAsync() does not work when replying to emails grouped by conversation #2317

Open DmitryKostochko opened 2 years ago

DmitryKostochko commented 2 years ago

In an Outlook add-in for compose mode, we use the Office.context.mailbox.item.body.getAsync() method to get the entire email body in the HTML format. The method never returns the whole body when the Settings -> View all Outlook settings -> Layout -> "How do you want your messages to be organized" option is set to "Show email grouped by conversation".

Your Environment

Expected behavior

The Office.context.mailbox.item.body.getAsync() method shall return the entire body.

Current behavior

The Office.context.mailbox.item.body.getAsync() method returns only your own HTML, i.e. the text that you wrote.

Steps to reproduce

  1. Sign in to Outlook Online by using for example the Chrome browser.
  2. Make sure the Settings -> View all Outlook settings -> Layout -> "How do you want your messages to be organized" option is set to "Show email grouped by conversation".
  3. Select an existing email in your Inbox, click the Reply All button, type something in the body.
  4. Execute the following code: var output = document.getElementById("output"); if (output) { output.value = ''; } Office.context.mailbox.item.body.getAsync('html', function (result) { console.log('Body', JSON.stringify(result)); if (output) { output.value += 'Body:' + '\r\n' + JSON.stringify(result) + '\r\n'; } });
  5. As you can see, the getAsync() method does not return the entire body.

Link to live example(s)

  1. You can use the following test add-in, click the item.body.getAsync() button: https://online-addins.ablebits.com/testaddin/manifest.xml
exextoc commented 2 years ago

Thanks for reporting this issue regarding Office.context.mailbox.item.body.getAsync API. It has been put on our backlog. We unfortunately have no timelines to share at this point. Internal tracking Id: 2523174.

teejay001 commented 2 years ago

Hi,

We are facing this same issue in our product development. Office.context.mailbox.item.body.getAsync() not returning the entire message chain in reply mode for OWA.

Please, is there any update or alternatives solution?

neville-jones commented 2 years ago

Same observation here - not getting the entire body when replying.

Any update or alternatives?

carlosb1504 commented 1 year ago

Hi, any updates on this one please? Inconsistent behaviour between platforms makes us and our customers 😥

nikhil452 commented 1 year ago

We are also facing the same issue. Any update on the fix. Is there any work around to get full body of mail trail without user clicking on old mail or ellipse(...).

exextoc commented 1 year ago

Thanks for your patience. We are currently investigating the issue. We will respond to this thread once we have an update.

ilbrando commented 11 months ago

We are experiencing the same problem and it is quite critical, because body.setAsync replaces the entire body - this means that we have no way of preserving the original body.

ilbrando commented 11 months ago

Update: it appears to behave differently in Outlook for Windows then in Outlook on web. On web the first time i set the body the original body is preserved, but not if I set it again. On Windows the original body is preserved all the time.

jlara005 commented 10 months ago

Any updates on this issue @exextoc? Any other way to get the full message chain in OWA using the API?

thao33 commented 1 month ago

We are experiencing the same issue right now. There were times when getAsync worked fine, but sometimes it doesn't work properly. What should we do?

ovdixon commented 2 weeks ago

I am facing the same issue. The workaround was to use Graph. Save the message as a draft then use this ID to fetch entire body.

abdellahyoujine commented 4 days ago

I was facing the same issue, the solution for me was to set body and get it after that:

Office.context.mailbox.item.body.setAsync("", { coercionType: Office.CoercionType.Text }, function (result) { Office.context.mailbox.item.body.getAsync("text", { asyncContext: event }, function(result){ console.log(result.asyncContext.value) }); });