Are there recommended practices for adding a link in Event email confirmations so that users can easily add the event to their Google Calendar? By default, CiviCRM offers that users download the .ical file, which they can then add to their calendar.
I would like to offer a direct "add to google" link. While not everyone uses Google (I'm one of those who do not), a few of my users have requested this feature.
For web pages, this library seems like a pretty good solution:
https://github.com/carlsednaoui/add-to-calendar-buttons
However, we cannot embed javascript code in emails, so it needs to be simpler. It seems like we can use an URL of the following form, which can be included in message templates:
<a class="icon-google" target="_blank"
href="https://www.google.com/calendar/render?action=TEMPLATE&text={event.title}&dates={event.start_time}/{event.end_time}&details={event.description}&location={event.location}&sprop=&sprop=name:"
>Add to Google Calendar</a>
NB: I did not test all of the above event variable names. The above probably does not work as-is.
I was wondering: has anyone else already implemented this? any suggestions? should I worry about timezones?