Search code examples
phpemailcalendargmailicalendar

How could you interface PHP with Gmail in a way such that calendar invite RSVP responses go to the organizer?


I am trying to design an application where the following events take place in order:

  1. An invite.ics file is created in PHP.
  2. An email is created with the invite attachment and sent from a specific email address through PHP (let's say [email protected]). It is sent to both the organizer and one other recipient ([email protected]).
  3. [email protected] logs into his/her email client and RSVPs "Yes".
  4. [email protected] receives the "Accepted: (event name)" email indicating that [email protected] has accepted the invite.
  5. Inbound email parser captures this email and puts it into my system; the system now knows that [email protected] has accepted the outbound invitation.

At step 4, things break down; the "Accepted: (event name)" email doesn't go to the organizer when the invitee RSVPs.

However, if I manually go into Google Calendar (logged in as [email protected]), create an event, then invite [email protected], it works fine. That is, when [email protected] RSVPs to that invite, [email protected] DOES get the "Accepted: (event name)" email.

I've compared the contents of the .ics files that are created in both cases, and they are virtually identical (except a few trivial things like description, etc.), so that can't be the reason for the discrepancy.

My inference is that the calendar event has to actually be ON [email protected]'s calendar in order to get the RSVP responses from the invitees... it's not enough to just be the organizer. But after exhaustive search I've not been able to confirm this.

Does anyone have any experience with this? Do I need to get the Google Calendar API involved? Hopefully there's a much simpler way to do this that I'm missing.

Thank you.


Solution

  • iCalendar does not support this currently. In the underlying concept of iCalendar and iTip, the program that generates the iCalendar object is the organizer.

    If you compare it to email, it would be somewhat similar to sending an email to somebody's outbox. As a sender, you don't have control over that, so in this context really your 'organizer' and the attendee(s) should all be attendees. One perhaps having ROLE=CHAIR. When replies come in, it's up to you to redistribute the replies to other attendees.