kishanvkc's avatar
kishanvkc
Copper Contributor
Jun 22, 2023
Status:
New

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

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.

 

 

 

9 Comments

  • hmaaheshwari's avatar
    hmaaheshwari
    Copper Contributor

    Hey I just wanted to have a follow up for the events that are needed to trigger web-add in when new Email is received in outlook or is there any alternate solution available for the same ?

  • EricLegault's avatar
    EricLegault
    Iron 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.

  • kishanvkc's avatar
    kishanvkc
    Copper Contributor

    Ok EricLegault 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 https://learn.microsoft.com/en-us/office/dev/add-ins/outlook/autolaunch

     

  • EricLegault's avatar
    EricLegault
    Iron 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.

  • EricLegault 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.  

  • EricLegault's avatar
    EricLegault
    Iron Contributor

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

  • kishanvkc's avatar
    kishanvkc
    Copper Contributor

    Hi, EricLegault 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?