Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding recipient in OnMessageSend times out the add-in #5132

Open
avisheknand opened this issue Nov 25, 2024 · 2 comments
Open

Adding recipient in OnMessageSend times out the add-in #5132

avisheknand opened this issue Nov 25, 2024 · 2 comments
Labels
Area: Outlook Issue related to Outlook add-ins Needs: attention 👋 Waiting on Microsoft to provide feedback Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP

Comments

@avisheknand
Copy link

avisheknand commented Nov 25, 2024

We would like to add a recipient to the email on the OnMessageSend event. When we do so, the event.completed executes but still shows the Addin is processing and times out. Can we add recipients in OnMessageSend event?

This issue happens on OWA , New Outlook for Windows. It works fine on the Classic Outlook for Windows

Your Environment

  • Platform [PC desktop, Mac, iOS, Office on the web]: OWA
  • Host [Excel, Word, PowerPoint, etc.]: Outlook
  • Office version number: ______
  • Operating System: Win 11
  • Browser (if using Office on the web): Edge

Below is the code i have:
image

Below is the behavior when sending email
image

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP label Nov 25, 2024
@JuaneloJuanelo JuaneloJuanelo added the Area: Outlook Issue related to Outlook add-ins label Nov 26, 2024
@pepso
Copy link

pepso commented Nov 26, 2024

@avisheknand It's possible you hit this bug (the right hand side / yellow warning): #4669 (comment)

Try to remove the recipient launch event and see if that fixes the issue to confirm the root cause.

While your onMessageSendHandler is being executed, the add recipient triggered another launch event (OnMessageRecipientsChangedHandler), which invalidated the event handler context your onMessageSendHandler is trying to call to complete the event before it got that far.

@rkpathak rkpathak added the Needs: attention 👋 Waiting on Microsoft to provide feedback label Nov 26, 2024
@avisheknand
Copy link
Author

@pepso,I guessed that as well. It seems the OnMessageRecipientsChangedHandler is causing a conflict. The only way to make it work is to completely remove the event from the manifest file:
<LaunchEvent Type="OnMessageRecipientsChanged" FunctionName="OnMessageRecipientsChangedHandler" />.
When I removed it from the manifest, I was able to add the recipient via the onMessageSend event.
Note: Commenting out the OnMessageRecipientsChangedHandler in the JS will not work; it needs to be completely removed from the manifest.

It’s strange that it works fine in Classic Outlook without removing the handler, but Classic Outlook uses a different environment to run this event compared to New Outlook and OWA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Outlook Issue related to Outlook add-ins Needs: attention 👋 Waiting on Microsoft to provide feedback Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP
Projects
None yet
Development

No branches or pull requests

4 participants