Unable to delete appointment using the ical file in outlook desktop client - email

We have the following requirement.
1) We need to generate an appointment with recurrence pattern, and send it to attendees.
2) Later we need to update, delete single occurrence out of the recurrence pattern.
3) We may also need to delete the complete the recurrent appointment in some cases.
By delete, we mean the meeting should be marked as cancelled in the invitee's calendar.
We are sending the appointments via our web app sending an email to the attendees with .ICS file embedded in email. We are generating the email using Java Mail API and embedding the .ICS file as multipart message keeping the MIME type as text/calendar.
Our invitees are using Microsoft outlook Desktop Client, Office 365 Web client, gmail.
We are able to send the appointment with recurrence pattern, and also able to update the specific occurrence of the meeting.
However we are facing difficulty with deleting the appointment or individual meeting specifically in the Outlook Desktop Client. When we send the delete event, in the invitee's mail box, it shows the button as "Remove from calendar" but doesn't mark the meeting as "cancelled" in the user calendar. The same is happening correctly in the Gmail web app.
I have tested it on the Outlook Version shown below
Office 365 MSO(16.0.11601.20184) 64 bit
I also tested a simple test case of creating a simple meeting using the below create.ics file(sending it as part of the mail) and then trying to delete the meeting using the delete.ics file below.
//create.ics
BEGIN:VCALENDAR
METHOD:REQUEST
PRODID:Microsoft Exchange Server 2010
VERSION:2.0
BEGIN:VTIMEZONE
TZID:India Standard Time
BEGIN:STANDARD
DTSTART:16010101T000000
TZOFFSETFROM:+0530
TZOFFSETTO:+0530
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:16010101T000000
TZOFFSETFROM:+0530
TZOFFSETTO:+0530
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
ORGANIZER;CN=Test Sirion:MAILTO:xyz#abc.com
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Kapil Gupta:MAILTO:abc#xyz.com
DESCRIPTION;LANGUAGE=en-US:\n
UID:040000008200E00074C5B7101A82E00800000000908EB51F4E28D501000000000000000
01000000000ED265B41C38B479A5315D1D23383D4
SUMMARY;LANGUAGE=en-US:New Meeting
DTSTART;TZID=India Standard Time:20190622T080000
DTEND;TZID=India Standard Time:20190622T083000
CLASS:PUBLIC
PRIORITY:5
DTSTAMP:20190621T105648Z
TRANSP:OPAQUE
STATUS:CONFIRMED
SEQUENCE:0
LOCATION;LANGUAGE=en-US:
X-MICROSOFT-CDO-APPT-SEQUENCE:0
X-MICROSOFT-CDO-OWNERAPPTID:-2091554845
X-MICROSOFT-CDO-BUSYSTATUS:TENTATIVE
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
X-MICROSOFT-CDO-IMPORTANCE:1
X-MICROSOFT-CDO-INSTTYPE:0
X-MICROSOFT-DONOTFORWARDMEETING:FALSE
X-MICROSOFT-DISALLOW-COUNTER:FALSE
X-MICROSOFT-LOCATIONS:[]
BEGIN:VALARM
DESCRIPTION:REMINDER
TRIGGER;RELATED=START:-PT15M
ACTION:DISPLAY
END:VALARM
END:VEVENT
END:VCALENDAR
//delete.ics
BEGIN:VCALENDAR
METHOD:CANCEL
PRODID:Microsoft Exchange Server 2010
VERSION:2.0
BEGIN:VTIMEZONE
TZID:India Standard Time
BEGIN:STANDARD
DTSTART:16010101T000000
TZOFFSETFROM:+0530
TZOFFSETTO:+0530
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:16010101T000000
TZOFFSETFROM:+0530
TZOFFSETTO:+0530
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
ORGANIZER;CN=Test Sirion:MAILTO:xyz#abc.com
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=Kapil Gupta:MAILTO:abc#xyz.com
DESCRIPTION;LANGUAGE=en-US:\n
UID:040000008200E00074C5B7101A82E00800000000908EB51F4E28D501000000000000000
01000000000ED265B41C38B479A5315D1D23383D4
SUMMARY;LANGUAGE=en-US:Canceled: New Meeting
DTSTART;TZID=India Standard Time:20190622T080000
DTEND;TZID=India Standard Time:20190622T083000
CLASS:PUBLIC
PRIORITY:1
DTSTAMP:20190621T110026Z
TRANSP:TRANSPARENT
STATUS:CANCELLED
SEQUENCE:1
LOCATION;LANGUAGE=en-US:
X-MICROSOFT-CDO-APPT-SEQUENCE:1
X-MICROSOFT-CDO-OWNERAPPTID:-2091554845
X-MICROSOFT-CDO-BUSYSTATUS:FREE
X-MICROSOFT-CDO-INTENDEDSTATUS:FREE
X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
X-MICROSOFT-CDO-IMPORTANCE:2
X-MICROSOFT-CDO-INSTTYPE:0
X-MICROSOFT-DONOTFORWARDMEETING:FALSE
X-MICROSOFT-DISALLOW-COUNTER:FALSE
END:VEVENT
END:VCALENDAR
Please let us know if there is any issue with the delete.ics file.
I have also put the code which we are using to send the mail in the below github gist, in case it is relevant.
https://gist.github.com/kapilgupta101292/92769d3e9f8e6444cb9dde5960473b1e
I have already tested by adding the X-WR-RELCALID as suggested in the following Stack overflow link but that doesn't work either -
Delete calendar event using iCalendar file import (Outlook 2003 problem)?
Please review the above ics file and let us know how to achieve the delete of the appointment.
Please let us know if any input is required, we need to quickly resolve this issue to deliver our webapp.

Related

iCal outlook email compatibility problems

I'm trying to generate an iCal file with multiple VEVENTs. I want to achieve one .ics-file, which has multiple appointments in it. It is important that these are not all-day appointments. So far, my generated file looks like this:
BEGIN:VCALENDAR
VERSION:2.0
PRODID: *** CENSORED ***
METHOD:REQUEST
X-MS-OLK-FORCEINSPECTOROPEN:1
BEGIN:VEVENT
UID:uuid-e4a9084f-91ea-4bc7-9bc0-3b2d6bec9030
DTSTART:20211122T070000Z
SEQUENCE:1
TRANSP:TRANSPARENT
STATUS:CONFIRMED
DTEND:20211122T160000Z
SUMMARY: TEXT
ATTENDEE;CN=FirstName_LastName;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;RSVP=FALSE;PA
RTSTAT=NEEDS-ACTION:MAILTO:*** CENSORED ***
CLASS:PUBLIC
DESCRIPTION: TEXT
ORGANIZER;CN=*** CENSORED ***:MAILTO:*** CENSORED ***
X-MICROSOFT-CDO-BUSYSTATUS:FREE
X-MICROSOFT-CDO-INTENDEDSTATUS:FREE
DTSTAMP:20211027T141024Z
LAST-MODIFIED:20211027T141024Z
END:VEVENT
BEGIN:VEVENT
UID:uuid-e4a9084f-91ea-4bc7-9bc0-3b2d6bec9030
DTSTART:20211123T070000Z
SEQUENCE:1
TRANSP:TRANSPARENT
STATUS:CONFIRMED
DTEND:20211123T160000Z
SUMMARY: TEXT
ATTENDEE;CN=FirstName_LastName;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;RSVP=FALSE;PA
RTSTAT=NEEDS-ACTION:MAILTO:*** CENSORED ***
CLASS:PUBLIC
DESCRIPTION: TEXT
ORGANIZER;CN=*** CENSORED ***:MAILTO:*** CENSORED ***
X-MICROSOFT-CDO-BUSYSTATUS:FREE
X-MICROSOFT-CDO-INTENDEDSTATUS:FREE
DTSTAMP:20211027T141024Z
LAST-MODIFIED:20211027T141024Z
END:VEVENT
END:VCALENDAR
So far so good. When I import this iCal-file to Google Calendar or even Outlook, both appointments are added correctly. The problem is when I attach the .ics-file to an email. Google Mail recognizes the attachment as as appointment and lets me Accept/Decline it in the email.
When I open the exact same email in Outlook, Outlook doesnt even recognize the attachment as an appointment. I also have the problem, that only one VEVENT, the first one, is added to the outlook calendar.
Is there something special about iCal attachments for Outlook? Can I do something to improve the compatiblity?
Multiple events within a single METHOD:REQUEST are only permitted where they have a single UID (ie they are part of the same multi instance event. See:
https://datatracker.ietf.org/doc/html/rfc2446#section-3.2.2
If the events are conceptually related, you could consider issuing the same UID and using RDATE https://datatracker.ietf.org/doc/html/rfc5545#section-3.8.5.2to distinguish the separate instances. It doesn't matter whether they are all day or not.
One can import multiple events as you have discovered.
Alternatively you could consider using METHOD:PUBLISH and having the user subscribe to their own personal appointments calendar if there are multiple separate events and you don't want to use RDATE.

How to create ics file that allow adding attendee on creation of Google calendar event

I am trying to create an .ics for Google Calendar, but when I try to add this event to my Google Calendar using the file, there isn't anyone the event's attendee list.
VERSION:2.0
PRODID:-//PYVOBJECT//NONSGML Version 1//EN
BEGIN:VEVENT
UID:20191205T041804Z - 44748#odoo-vagrant
DTSTART:20200103T140000Z
DTEND:20200103T150000Z
ATTENDEE:MAILTO:dang.nguyen#novobi.com
ATTENDEE:MAILTO:admin#yourcompany.example.com
CREATED:20191205T041803Z
DESCRIPTION:Phone: (098) 159-4793\nEmail: dang.nguyen#novobi.com\n
DTSTAMP:20191205T041804Z
LOCATION:https://zoom.us/j/308566271
ORGANIZER:MAILTO:admin#yourcompany.example.com
SUMMARY:Odoo Accounting with Dang Nguyen
BEGIN:VALARM
ACTION:AUDIO
DESCRIPTION:15 Minute(s)\, by e-mail
TRIGGER;RELATED=START:PT15M
END:VALARM
END:VEVENT
END:VCALENDAR
Can anyone help me with this issue ?

Shows only one VEVENT (first) from many in .ics file

Here is the ICS file content:
BEGIN:VCALENDAR
PRODID:-//Test//Test 1.0//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:PUBLISH
BEGIN:VTIMEZONE
TZID:Asia/Tokyo
X-LIC-LOCATION:Asia/Tokyo
END:VTIMEZONE
BEGIN:VEVENT
DTSTAMP;TZID=Asia/Tokyo:20190108T154626
UID:a0K1I000007ljAxUAI-a0D1I000007daO4UAI
RELATED-TO:a0K1I000007ljAxUAI
DTSTART;TZID=Asia/Tokyo:20190123T080000
DTEND;TZID=Asia/Tokyo:20190123T200000
SUMMARY:XXXXXXXXXXXXXXXXXXXX2
LOCATION:XXXXXXXXXXXXXXXXXXXX2
DESCRIPTION:XXXXXXXXXXXXXXXXXXXX2
TRANSP:OPAQUE
END:VEVENT
BEGIN:VEVENT
DTSTAMP;TZID=Asia/Tokyo:20190108T154626
UID:a0K1I000007ljAxUAI-a0D1I000007daNzUAI
RELATED-TO:a0K1I000007ljAxUAI
DTSTART;TZID=Asia/Tokyo:20190110T080000
DTEND;TZID=Asia/Tokyo:20190110T200000
SUMMARY:XXXXXXXXXXXXXXXXXXXX1
LOCATION:XXXXXXXXXXXXXXXXXXXX1
DESCRIPTION:XXXXXXXXXXXXXXXXXXXX1
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR
In Thunderbird and Gmail I able to see only first (by order) event. Is this normal behaviour for mail clients, should I create separate .ics file for each VEVENT then and send it with single mail? Thanks in advance for help!
Separate them. I don't know a calendar app that allows one to 'invite' someone to multiple events at the same time. One can of course send a multi event file and ask the user to import it (but for multi events sometimes subscribe is better). If one sends an ics file generated by google calendar, it does the same thing (along with option to download ics file), so nothing to do with your file.
If the need is to have a person see multiple events at a time, a better approach would be to offer them a personal subscribeable ics url. That way they see it separately in their calendar app and it will update/refresh when there are changes.

ics event update failed in web calendar

I am trying to create a ics feed for users to subscribe via webcal. The feed's content comes from database and looks like the following.
When the database is updated, the feed changes and updates the subscribers' calendars. It works fine with google calendar and some calendar apps. However, I never observe updates in outlook.com (the web calendar) or Yahoo calendar. Is there something wrong in the feed so update fail?
The feed is provided through webcal://example.com/subscribe.php
and I put header('Content-Type: text/calendar; charset=UTF-8');
as the first PHP line
ics:
BEGIN:VCALENDAR
PRODID:-//Organisation//Roster//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:PUBLISH
X-WR-CALNAME:Duty Arrangement
X-WR-CALDESC:Duty Arrangement
X-WR-TIMEZONE:Asia/Hong_Kong
REFRESH-INTERVAL;VALUE=DURATION:PT6H
X-PUBLISHED-TTL:PT6H
BEGIN:VEVENT
DTSTART:20180218T020000Z
DTEND:20180218T033000Z
DTSTAMP:20180602T144036Z
UID:228Mip5LyZ5JqY5#organisation.com
DESCRIPTION:Task A
LOCATION:Office
SUMMARY:On Duty
TRANSP:OPAQUE
END:VEVENT
BEGIN:VEVENT
DTSTART:20180304T020000Z
DTEND:20180304T033000Z
DTSTAMP:20180602T144036Z
UID:230Mip5LyZ5JqY5#organisation.com
DESCRIPTION:Task B
LOCATION:Office
SUMMARY:On Duty
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR
You have the UID but ICS file events need a SEQUENCE number to indicate which update/version of the event is the latest.
See the specification https://www.rfc-editor.org/rfc/rfc5545#section-3.8.7.4
For recurring event instances, they also need a RECURRENCE-ID of the instance being modified.

How to add/modify events in Google calendar with ICS file

I'm trying to create an ICS file to add events to a Google calendar via email. In the end, the calendar will be sent to multiple users, from a desktop app. Ideally I'd like to be able to modify the calendar if the events change (just event times, I'm ignoring cancelled events)
Here is my ICS file
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//MY COMPANY//Calendar//EN
CALSCALE:GREGORIAN
METHOD:PUBLISH
BEGIN:VEVENT
UID:shift-439-emp-128#mycompany.com
DTSTART:20180604T090000
DTEND:20180604T153000
DTSTAMP:20180519T081800
SUMMARY:Morning shfit
LOCATION:Morning Location
DESCRIPTION:Morning shift
END:VEVENT
BEGIN:VEVENT
UID:shift-446-emp-128#mycompany.com
DTSTART:20180605T153000
DTEND:20180605T233000
DTSTAMP:20180519T081800
SUMMARY:Night shift
LOCATION:
DESCRIPTION:Night
END:VEVENT
END:VCALENDAR
When I email that file to my gmail account, I can see a "Add to Google calendar" button which I can use to add the events to my prinary calendar.
Now, say the events times changed.
Question : How can I create a new ICS file with the new times so that existing events will be modified in google calendar?
I used UIDs for events so that google does not create duplicate entries. But when I email a second ics file with modified events (with uids), the "add to google calendar" button does not appear. If I try to manually import the ics file from google calendar Import feature, then I get this error message
Could not upload your events because you do not have sufficient access on the target calendar.
If I set different UIDs each time, the import process will work but duplicate entries will be created.
I also tried using REQUEST instead of PUBLISH method
Thanks
I was able to get this working with Gmail using the following:
METHOD: set to REQUEST
SEQUENCE: Set to 0 on first request and increment by 1 each time
ATTENDEE: Identify the Gmail user that is receiving the email by email address
Other variations would have non-desirable effects:
Only seeing 1 of the two events
Not updating existing event
Office 365 sends ICS files to Gmail that can be updated so it can be used to reference a commercial implementation. You can see the requests Outlook 365 sends by using "Show Original" in Gmail to retrieve the base64 encoded calendar body. Outlook 365 uses many other fields so it's instructive to examine.
I have a test script in Go using SparkPost so if you have any questions or would like to use it, just let me know. SparkPost has a free tier but you still need to configure your outbound sending domain to use it.
Here is an example modified request. I just increment the SEQUENCE and change the time to update the request in Gmail.
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//MY COMPANY//Calendar//EN
CALSCALE:GREGORIAN
METHOD:REQUEST
BEGIN:VEVENT
ATTENDEE;ROLE=REQ-PARTICIPANT;CN=example#gmail.com:MAILTO:example#gmail.com
UID:shift-1807-emp-128#mycompany.com
DTSTART:20180807T010000
DTEND:20180807T020000
DTSTAMP:20180601T033455
SEQUENCE:0
SUMMARY:Morning shift
LOCATION:Morning Location
DESCRIPTION:Morning shift
END:VEVENT
BEGIN:VEVENT
ATTENDEE;ROLE=REQ-PARTICIPANT;CN=example#gmail.com:MAILTO:example#gmail.com
UID:shift-1808-emp-128#mycompany.com
DTSTART:20180807T130000
DTEND:20180807T140000
DTSTAMP:20180601T033455
SEQUENCE:0
SUMMARY:Night shift
LOCATION:Night Location
DESCRIPTION:Night
END:VEVENT
END:VCALENDAR
Of note, when sending multiple events in a single ICS file, sometimes it takes Gmail a second or so to show both events with the correct time in my testing.