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
665 stars 94 forks source link

OnMessageAttachmentsChanged event doesn't work if we use "Upload and share as one drive link" when attaching local file to email #4677

Closed pza-dev-brcm closed 1 month ago

pza-dev-brcm commented 1 month ago

We are using ItemSend event in outlook add-in where we monitor email content like subject, body, recipients, attachments and based on policy we decide whether to allow or block the email. For optimisation, we are handling OnMessageAttachmentsChanged event too in add-in. As a result, when user attaches any file to email we get callback and we do some processing as per business logic.

When we attach file from local disk having size > 5/10 MB we get option in outlook to attach this file as

  1. Attach as a copy
  2. Upload and share as OneDrive link

Things works fine when we select "Attach as a copy option". But when we select "Upload and share as OneDrive link" option, we don't get callback in OnMessageAttachmentsChanged event handler. Also, in ItemSend event if we use Office.context.mailbox.item.getAttachmentsAsync API we don't get any details if we had selected , "Upload and share as OneDrive link" option while attaching an attachment.

Your Environment Platform [PC desktop, Mac, iOS, Office on the web]: PC Desktop Host [Excel, Word, PowerPoint, etc.]: New Outlook Office version number: Microsoft Outlook Version 1.2024.103.100 (Production) | Client Version 20240119003.15 . Operating System: Windows11 Browser (if using Office on the web): NA

rkpathak commented 1 month ago

Thanks for reporting this issue. It has been put on our backlog. We unfortunately have no timelines to share at this point.

Internal tracking id: Office: [290659]

microsoft-github-policy-service[bot] commented 1 month ago

This issue has been automatically marked as stale because it is marked as needing author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thank you for your interest in Office Add-ins!

microsoft-github-policy-service[bot] commented 1 month ago

This issue has been closed due to inactivity. Please comment if you still need assistance and we'll re-open the issue.

DivyaPatidar commented 1 month ago

@pza-dev-brcm This is by design, since when the user selects 'Upload to One Drive', the item is no longer an attachment. Instead it becomes a hyperlink or URL that routes to the file uploaded on OneDrive. Thus, this issue is not related to attachments, as the file is added to the email body via a URL.