Well, I created a litle script to generate iCal events and automatically add it to the calendar using the webcal protocol.
The script worked as follows: I host the ical-generator.php file on the server and send a url with the necessary information by adding the webcal at the beginning.
webcal://www.test.com/ical-generator.php?id=66038&titulo=Teste&data-inicio=20190311&data-final=20190312&local=Teste&descricao=Lorem Ipsum dolor&url=http://www.test.com/
However, when I import the event into the calendar, this event, which is unique, ends up being added as a new calendar and not as a single event, which should be added to the user's existing calendar.
Here's the script:
<?php
header("Content-type: text/calendar; charset=utf-8");
header("Content-Disposition: inline; filename=\"teste-evento-".$_GET['titulo'].".ics" ."\"");
echo "BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//TESTE//NONSGML Teste//EN
CALSCALE:GREGORIAN
METHOD:PUBLISH
BEGIN:VEVENT
UID:".$_GET['id']."-teste.com.br
ORGANIZER;CN=TESTE:MAILTO:teste@teste.com.br
SUMMARY:".$_GET['titulo']."
STATUS:CONFIRMED
DTSTART:".$_GET['data-inicio']."
DTEND:".$_GET['data-final']."
DTSTAMP:".date('Ymd').'T'.date('His')."
LOCATION:".$_GET['local']."
DESCRIPTION:".$_GET['descricao'].".\nSaiba mais em: ".$_GET['url']."
URL:".$_GET['url']."
CLASS:PUBLIC
TRANSP:TRANSPARENT
PRIORITY:5
SEQUENCE:0
X-MICROSOFT-CDO-IMPORTANCE:1
END:VEVENT
END:VCALENDAR";