Hi all, i'm newbie with dokuwiki, but i have created a form using the Mail Mode and the field usemailtemplate
to define alternative content for the mail and generated a Google Calendar Link.
Here's a new link structure that seems to support the new google version of google calendar w/o requiring API interaction:
https://calendar.google.com/calendar/r/eventedit?text=My+Custom+Event&dates=20180512T230000Z/20180513T030000Z&details=For+details,+link+here:+https://example.com/tickets-43251101208&location=Garage+Boston+-+20+Linden+Street+-+Allston,+MA+02134
New base url: https://calendar.google.com/calendar/r/eventedit
New parameters:
text (name of the event)
dates (ISO date format, startdate/enddate - must have both start and end time)
an event w/ start/end times: 20131208T160000/20131208T180000
all day events, you can use 20131208/20131209 - end date must be +1 day to whatever you want the end date to be.
ctz (timezone such as America/New_York - leave blank to use the user's default timezone. Highly recommended to include this in almost all situations. For example, a reminder for a video conference: if three people in different timezones clicked this link and set a reminder for their "own" Tuesday at 10:00am, this would not work out well.)
details (url encoded event description/details)
location (url encoded location of the event - make sure it's an address google maps can read easily)
add (comma separated list of emails - adds guests to your new event)
Notes:
the old url structure above now redirects here
supports https
deals w/ timezones better
accepts + for space in addition to %20 (urlencode vs rawurlencode in php - both work)
In my form i get @text@ , @startdate@ and @enddate@ , i want to generate the link for only all day events :
<a href="https://calendar.google.com/calendar/u/0/r/eventedit?text=@@text@@&dates=@DATE(@@startdate@@,%%Y%%m%%d)@/@DATE(@@enddate@@,%%Y%%m%%d)@&details=Describe+your+event.&location&trp=true">Add to your Google Calendar</a>
The problem is that for all day events, you can use 20131208/20131209 - end date must be +1 day to whatever you want the end date to be.
In my Mail Template Page i have added in html code this workaround :
<?php
$date=date_create("@DATE(@@enddate@@,%%Y%%m%%d)@");
date_add($date,date_interval_create_from_date_string("1 days"));
$dateadd=date_format($date,"Ymd");
?>
<a href="https://calendar.google.com/calendar/u/0/r/eventedit?text=@@text@@&dates=@DATE(@@startdate@@,%%Y%%m%%d)@/<?=$dateadd?>&details=Describe+your+event.&location&trp=true">Add to your Google Calendar</a>
But it doesn't work , i think that the mail template mode can only use html code .... Any Idea ???