Outlook Add-ins: Can we have a new event that trigger if any new email received in mailbox

Outlook Add-ins: Can we have a new event that trigger if any new email received in mailbox
0

Upvotes

Upvote

 Jun 22 2023
8 Comments (8 New)
New

We have worked on OfficeJs-based add-ins for the last 3 years and have delivered many projects to our clients. Currently, Outlook has a limited list of event-based features. Please think about a new event for ReceivedEmail.


There are many requirements that come from clients for their product that deals with new emails received in a mailbox but unfortunately, we can't do by office-based add-ins.

In VSTO, we can handle it.

 

 

 

Comments
Brass Contributor

Processing emails is best implemented using Graph change notifications. OfficeJS simply doesn't have the architecture to handle batch processing properly.

Copper Contributor

Hi, @Eric Legault Yes, we are suggesting Graph APIs. But in that case, the side panel should remain open in Outlook. Can it possible with Ui less IF then on which event we can triggers the add-ins command?

 

 

Brass Contributor

Graph cannot use Office JS or communicate or control the Outlook or add-in UI. Can you please clarify your last sentence?

Copper Contributor

@Eric Legault @kishanvkc I am also trying to get change notifications from graph APIs in outlook web add-in but it only gives notifications if our web add-in task pane is opened otherwise we are not able to get change notifications  in background.

 

So We suggest to give new LaunchEvent from which we can get new outlook notifications.

Or you can suggest any option to get outlook change notification in background from Runtime.JS file from outlook web add-in.

 

Please check raised ticket on git as given below-

https://github.com/OfficeDev/office-js/issues/3446 

 

Thanks.  

Copper Contributor

@Rajnish_Suthar_Asite Yes. The change notification only work if side panel is opened @Eric Legault I was pointing you the same

 

Brass Contributor

The endpoint to process change notification and lifecycle responses from Graph must be publicly accessible in your Web API. You cannot receive these in web pages that are loaded from client-side processes like an add-in task pane. After your Web API processes these responses, you can then read or manipulate the affected Outlook items (e.g. apply categories, flags, move emails to folders, etc.). However, if your add-in needs to interact with the affected items, you will need to send a request to your Web API from the add-in and have it return whatever data you need or do something else.

Copper Contributor

Ok @Eric Legault with this workflow, I completely understood. But it would be nice if we have such functionalty for autolunch events of outlook like ("OnNewEmailRecieved" OR "OnEmailRecieved"). Currently, outlook is supporting very few events reference docs

 

Brass Contributor

I agree @kishanvkc, those events are needed. I have been recommending them to the Outlook add-in team for a long time. However, I'm skeptical that it will be coming any time soon as I suspect the implementation in Office JS would be very difficult. Graph change notifications is the best option for now, and perhaps always will be.