Sunday, March 8, 2009

Automating emails to cancel iCalendar events

In a follow up to my post about emailing iCalendar requests,you may wish to send out an automated email to cancel that request and have the user automatically be prompted to remove it as well.  That can be handled with minor modification to the previous script and .ics files.

First, find the following piece of code:
icspart = MIMEBase('text', 'calendar', **{'method' : 'REQUEST', 'name' : 'meeting.ics'})
and change that to a CANCEL method:
icspart = MIMEBase('text', 'calendar', **{'method' : 'CANCEL', 'name' : 'meeting.ics'})
Next, in the original .ics file, change any line with METHOD: to read METHOD:CANCEL and any line with STATUS: to read STATUS:CANCELLED.

No comments:

Post a Comment