Outlook add-in: take action on calendar event date and time changes - outlook-addin

We have an Outlook office.js add-in which uses add-in commands to help our users create a custom calendar event. We would like to perform some actions when that event's date or time is changed by the user.
With the older COM-based Outlook add-ins this was possible since you could have your add-in start-up automatically when a particular calendar event was opened add you could hook into the send event.
With the new add-in commands model there are problems. Here is what I understand so far:
When the user edits their event date or time while the add-in task pane is open, there is no way to be informed that they made changes. Worst yet, the user can open the event up later from their calendar and unless they triggered your add-in task pane, your add-in will not even be running. The user has to manually trigger an Outlook add-in command to open your task pane since the task pane cannot auto-trigger based on some detectable data attached to the calendar item.
If you hook into the send event you might be able to call the Outlook REST API to get the date and time and perform actions. Unfortunately, to hook into the on send event you need an Administrator to turn on that feature and your add-in will be rejected for Office Store Validation. Besides, I am not sure if the on send event works for calendar items. It seems like it is limited to emails.
If you want to use the Outlook Notification REST API to be notified about calendar event creation/modification/deletion, that notification subscription is time limited, does not have a way to auto-renew the notification subscription, and there does not seem to be built-in way to pass back custom parameters to the notification listener.
I hope I was clear enough and that the details I list above are accurate.
Does anyone have any suggestions on how we can automatically perform actions when the user edits the date or time of one of the calendar events created by our add-in?

This is done by leveraging Webhook Subscriptions and Event Deltas via Microsoft Graph.
The webhook will get fired off whenever it detects a change to the calendar. When you receive the event, you request the calendar delta from Microsoft Graph. This will give you all of the events that were changed since the last time you polled. From here you can request a specific event, including any extended data you previously stored with that event.
As for renewals, when you create the subscription it returns the expirationDateTime for that subscription. When your subscription expires, you can renew it and receive a new expiration date:
PATCH https://graph.microsoft.com/v1.0/subscriptions/{id}
Content-Type: application/json
{
"expirationDateTime": "2016-03-22T11:00:00.0000000Z"
}

Related

Best approach to update an existing event in multiple Microsoft accounts using Microsoft Graph API

I am working on a calendar synchronization between my application and personal calendars of the users. The idea is that every time an event is created or updated, this event is sent to the personal calendar of the users (they can choose syncing to Google Calendar and/or Microsoft accounts calendar).
I have this complete flow working with Google Calendar and now I am working with Microsoft oAuth and Graph API to make it work either for MS Calendars.
Currently, for MS, I have the following scenario implemented and working:
User authorizes the application to access its calendar through consent page
Server exchanges the authorization code for an access token
I can insert an event in user's calendar using its access token as Authorzation header through Microsoft Graph API (POST https://graph.microsoft.com/v1.0/me/events)
Now I am trying to figure out how I can manage event updates (when start date changes, for instance, how I will send this update for each user's MS account), knowing the following constraints of Microsoft Events API:
Property "ICalUId" is generated by MS API itself and returned in the response of Insert endpoint. I can't insert an event with my own ICalUId. This is possible with Google Calendar and very useful, because if I send an event with an existing iCalUId to import endpoint, Google updates this existing event with the sent data, and if the iCalUId doesn't exist, Google creates the event (it performs an upsert-like action).
For each event inserted at different users calendar, a new "ICalUId" is generated, even if I am sending the same event object to insert. So I get many iCalUId's for the same event, this adds complex in tracking this event in users calendars, different from Google Calendar as I mentioned before.
So that's the challenge I am facing right now. Any ideas on how I can achieve this?
Thanks in advance!

How to send a request to my add in when a user changes the date of a meeting inside outlook (without opening the add-in)?

I'm building an Outlook Add-in where the user can book a meeting directly from outlook. The add in is basically a shortcut to the website we usually use, but instead we take the data from the outlook meeting (Date, title, etc..). The problem is that once the user has created a meeting and it has been saved in our database (and they close the add-in), the add-in can't detect if they change the meeting date, and therefore it doesn't get updated in the database.
Shortly put: Is there any way that my add-in can communicate with outlook and fire a function without being opened?

sharepoint registration change notification

I have a class registration set up in SharePoint 2013. Users are emailed when they register for a class. I want to create email notifications when the Start Date, Start Time or Location [fields] of the Session changes. I only want to email the users that have registered for said Session (between 1 and 400 people).
I should be able to handle this with an Alert or an Event, but can't figure it out. My SharePoint team is telling me that this is too difficult because "the columns are in Sessions [list] and not in Registrations [list view].
I've found a lot of information on general SharePoint alerts, but I can't find anything on sending notifications to a select group of users, based on another field.
You could create event receiver for the list and send email by SPUtility.SendEmail with dynamic users.
You could check sample code from here.
Create event receiver in SharePoint 2013.

Turn off Outlook new email notifications for specific duration

Is there a way with VBA in Outlook 2013 to turn off new email notifications for a specified duration of time? I work a lot out of email, and am currently attempting to use the Pomodoro technique for maintaining focus. To stop myself from switching attention to newly arrived emails while doing a Pomodoro, I'd like to be able to turn notifications off for a period of 30 minutes.
The UI notification options for newly delivered emails can be changed by setting a registry key, but the changes won't take effect until Outlook is restarted. Otherwise there is no option in the Outlook Object Model to reliably turn off receiving for all accounts as disabling send/receive will not affect Exchange or Office 365 accounts. Your best option is to automate clicking the Work Offline ribbon button on the Send/Receive tab.

Outlook Add-in for Office 365 is not being activated by default

We have created an Outlook add-in and installed it on Office365 account but every time when I login and after I perform any action I have to manually click on add-in to activate. I do not want this. I want to run the add-in in background so it will active once I login to my office365 outlook account and it should remain active by default is there any way to achieve this.
Thank you.
This compose scenario for the mail add-in need the users to active the add-in. However the latest feature named add-in command enable the add-in has placed new buttons on the command ribbon. So users are not required to active the add-in first to make it work, then can just click the command on the ribbon. Here is an figure for your reference:
However, current it only work for the Outlook 2016.
If you were find a solution for all the client, you may consider using transport rules or journaling instead of the mail add-in. You can refer to the link below for more detail:
http://blogs.technet.com/b/exchange/archive/2010/01/28/3409250.aspx
Currently, the add-in model is designed such that users have to manually run the add-ins. Running automatically is a new feature request, which other developers have asked for as well in our User Voice page, please feel free to upvote it here: https://officespdev.uservoice.com/forums/224641-general/suggestions/10770030-autorun-outlook-add-ins.