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
671 stars 96 forks source link

Let our Office MessageComposeCommandSurface Add-ins read *all* the users email-being-composed content and options. #2113

Closed gitcnd closed 2 years ago

gitcnd commented 3 years ago

Trying to write a useful add-in for Outlook is excessively limited, owing to a large number of important bits of user context not being accessible to us.  It would be useful if the following could be properly added:-

getAttachmentContentAsync for *all* the users attachments (not just appointments/etc)

Settings: Importance and Sensitivity Voting and Tracking Options: Delivery-receipts and read receipts Security: Encryption, digital signing, and labels Delivery options: reply-to email address, send-delay and expires-after info and Categories

(e.g. see https://github.com/OfficeDev/office-js/issues/2111 )

exextoc commented 3 years ago

You are correct that not all the properties are completely available. It would be helpful for prioritization with the product team if you can discuss more about your scenarios and priorities for your scenarios.

There is some support for the APIs you listed: getAttachmentContentAsync supports file, embedded email and appointment. It would be great if you can discuss the other types you are looking for because the file format for embedded items can be platform dependent.

Categories are documented here: https://docs.microsoft.com/en-us/javascript/api/outlook/office.categories?view=outlook-js-preview

For the other APIs you requested that are not a part of the product, we track Outlook add-in feature requests on our Tech Community Page. Please submit your request there and choose the appropriate label(s). Feature requests on Tech Community are considered, when we go through our planning process.

gitcnd commented 3 years ago

The doc (I can't find where now, but its on your site) specifically says that getAttachmentContentAsync works only for meetings and forwarding other emails. Not for files. Here is your code from Office.js for this:-

    if (isAttachmentOfItemType(attachmentModel.model)) {  // <<-- HERE
        const embeddedItemClass = attachmentModel.model.EmbeddedItemClass;
        if (
            embeddedItemClass &&
            embeddedItemClass !== 'IPM.Note' &&
            embeddedItemClass !== 'IPM.Appointment'
        ) {
            callback(createErrorResult(ApiErrorCode.AttachmentTypeNotSupported));
            return;
        }
    }

It's also a moot point - your software crashes if you attempt to retrieve a file attachment:- https://github.com/OfficeDev/office-js/issues/2112#issuecomment-921554764

And if that wasn't bad enough - instead of making a useable functional product, Office.js developers instead are documenting the bugs rather than fixing them - even if any of the above actually did "work", it's still not useful because you say:-

Important: If a message/calendar item was attached by drag-and-drop in Outlook on the web, then getAttachmentContentAsync throws an error.

How are we supposed to write working Add-ins, when half the API calls are riddled with show-stopping bugs that, instead of being fixed, are being documented ?

Important: In Outlook on the web, you can't use the API to manage categories applied to a message in Compose mode.

Does your team accept outside contributions? Many of the problems that are plaguing my development are relatively simple to solve - I'd be willing to submit the solution code if your team would commit to making time to review, test, and deploy it.

exextoc commented 3 years ago

Thanks for your feedback so far. We have updated some of the documentation based on your feedback in other issues. And we're looking into some of the additional issues you brought up.

We mentioned this before but please do open a request for the new APIs here: https://aka.ms/m365dev-suggestions

We'll typically add groups of related APIs in a single release to enable new scenarios. Please consider adding a description of your scenario to the feature request, or to use this space to do that. It helps us plan so we aren't adding just some of the APIs you need to implement a scenario.

exextoc commented 2 years ago

Hi, we have fixed the bug where getAttachmentContentAsync would throw an error on drag and drop items. Can you confirm whether the fix is available to you or not? We will soon be updating the documentation to reflect this change as well. On the categories API for Outlook Web, we are currently restricted due to Outlook host limitations. We recommend that you share this as a feature request on https://aka.ms/m365dev-suggestions We really appreciate your patience and feedback on this. Thank you

SWei1234 commented 2 years ago

Hi @exextoc I have the same question on get 'Sensitivity' setting. Actually, I have already get 'Sensitivity' setting from a saved event. But the problem is I can't get this setting on a composing event, no matter I using rest-api or office.js. Does Microsoft support add-in get 'Sensitivity' setting on compose now? Thanks

exextoc commented 2 years ago

Please create a new GitHub post for your query.

exextoc commented 2 years ago

Closing this bug as per the answer posted on Oct 21, Please reopen if you still see any issues again.