1

I am trying to write an Outlook add-in in NodeJS which reads the content of a mail and search for some specific strings. To do so, I need to get a notification when a new mail is received.

However, the event-based actions described in the Microsoft documentation only seem to refer to writing/sending mails, and not receiving them : https://learn.microsoft.com/en-us/office/dev/add-ins/outlook/autolaunch

Has anyone ever dealt with this situation, or would be able to lead me to the proper notification ? I am searching the "OnMessageReceived" kind of event.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
MedAl
  • 457
  • 3
  • 19

1 Answers1

1

Outlook web add-ins work under the context of currently selected item only. You can handle item-level events only (or selection change with a pinnable task pane).

Consider using Microsoft Graph API for handling incoming emails, see Q: How to handle all inbound and outbound mails in Office365/Exchange online? for more information.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
  • Ok it all makes sense now ! I indeed found documentation to interact with the "current element", but couldn't find something event-based. I will use this approach then. I cannot use Graph as I wish my add-on to not ask for any token/credentials/other secrets. – MedAl Jan 04 '22 at 08:14