0

I want to pre-populate the URL box at

https://calendar.google.com/calendar/u/0/r/settings/addbyurl

with my calendar feel link webcal://domain.co.uk/calendar/export.php?Staff=Mr+Alan+Smith

is there any functionality to create a subscribe link so users don't have to manually copy and paste the URL in ?

Henry Aspden
  • 1,863
  • 3
  • 23
  • 45
  • Does this answer your question? [Link to add to Google calendar](https://stackoverflow.com/questions/10488831/link-to-add-to-google-calendar) – PatrickdC Dec 07 '22 at 05:58
  • No @PatrickdC as these are all individual events, what I'm looking for is like the O365 system where you can pre-populate the URL for a calendar subscription... Like so... `https://outlook.office.com/calendar/addcalendar?name=NAME&url=webcal://domain.co.uk/calendar/export.php?Staff=Mr+Alan+Smith` – Henry Aspden Dec 07 '22 at 07:07

1 Answers1

1

Found the answer

https://www.google.com/calendar/render?cid=webcal://domain.co.uk/calendar/export...

doesn't like spaces so I also swapped spaces for _ in the url where I had spaces (%20 or +) in staff names e.g.

webcal://domain.co.uk/calendar/export.php?Staff=Mr+Alan+Smith or webcal://domain.co.uk/calendar/export.php?Staff=Mr Alan Smith becomes webcal://domain.co.uk/calendar/export.php?Staff=Mr_Alan_Smith

in my export.php which creates the ICS files it fetches, I then did a str_replace() to swap back the value to spaces.

$staff = $_GET['Staff']; $staff = str_replace("_"," ",$staff);

Henry Aspden
  • 1,863
  • 3
  • 23
  • 45