I am generating iCalendar files with Django and python-icalendar, and they correctly show up in Outlook (2010) as meeting invitations. In Gmail (Google Apps), I just see a blank email. What's the deal? Here's what one of my .ics files looks like:
BEGIN:VCALENDAR
METHOD:REQUEST
PRODID:-//My Events App//example.com//
VERSION:2.0
BEGIN:VEVENT
ATTENDEE;CN=Richard;ROLE=REQ-PARTICIPANT;RSVP=TRUE:MAILTO:rich@example.com
CREATED;VALUE=DATE:20101122T183813
DESCRIPTION:Phone number: (212)-123-4567\n\nThis is a test description
for the conference call.
DTEND;VALUE=DATE:20101127T131802Z
DTSTAMP;VALUE=DATE:20101127T121802Z
DTSTART;VALUE=DATE:20101127T121802Z
LAST-MODIFIED;VALUE=DATE:20101122T183813
ORGANIZER;CN=Example.com:events@example.com
SEQUENCE:1
SUMMARY:Conference call about GLD
UID:example.com.20
END:VEVENT
END:VCALENDAR
Oh, and I'm using Django's EmailMultiAlternatives to attach the ics content, like so:
if calendar:
message.attach_alternative(calendar.as_string(), "text/calendar; method=REQUEST; charset=\"UTF-8\"")
message.content_subtype = 'calendar'
I had to play around with .ics files ages ago, and came up with a little helper app named django-cal, which simplifies the whole process.
It's not in active development anymore, but seems to still satisfy the need of a few people. Patches and improvements very welcome!
This may be a little late, but here is my implementation as a helper function in my model (it's an "event" model that contains a date as a property of itself):
And then in the function that sends the email, I have:
That solution uses icalendar (which I prefer to vobject), and it also uses attach_alternative() to attach (literally) an alternative version of the message. The attach() function is being used to toss in the calendar file, regardless of the version of the message that the email client chooses to render (note that I also gave it an ".ics" extension).
I realize that you are using python-icalendar, but the attach() method should still work about the same. I just decided to also show you an alternative implementation to generating iCal files.