okay, been going round in circles with this, trying to get content on a new line or fold. I've tried two validators and can get this valid but it gives me line length warnings - https://icalendar.org/validator.html
I have no clue how to enter a CRLF as described in spec - https://www.rfc-editor.org/rfc/rfc2445#section-4.1
This validator tells me \n is outdated but when I change to \r\n, it invalidates my DESCRIPTION. - http://severinghaus.org/projects/icv/
I've also tried to escape using "\n" instead of "\n"
I've tried DESCRIPTION;ALTREP=" . $url . ":". $description ."
I've tried
$description = str_replace("\r\n", '\n', $htmlMsg);
$description = str_replace("
",'\n',$description);
$description = (str_replace(";",";",str_replace(",",',',$description)));
in combination with DESCRIPTION:" . $description . "
I've tried
$htmlMsg = "Adding event to your schedule does not confirm your reservation.\nVisit http://www.website.com for attendance details."
$temp = str_replace(array("\r\n"),"\n",$htmlMsg);
$lines = explode("\n",$temp);
$new_lines =array();
foreach($lines as $i => $line)
{
if(!empty($line))
$new_lines[]=trim($line);
}
$desc = implode("\r\n ",$new_lines);
php currently:
$output = "BEGIN:VCALENDAR
METHOD:PUBLISH
VERSION:2.0
PRODID:-//App, Inc.//Calendar//EN
X-WR-TIMEZONE:America/Los_Angeles
CALSCALE:GREGORIAN\r\n";
foreach ($events as $event):
$numb = $numb+1;$output .=
"BEGIN:VEVENT
ORGANIZER;CN=BB:MAILTO:[email protected]
DTSTAMP:" . date(dateToCal) . "
SUMMARY:" . $event['te']['title'] . "
UID:" . $numb . $event['te']['id'] . "
DTSTART:" . gmdate(DATE_ICAL, strtotime($event['te']['sdate'])) . "
DTEND:" . gmdate(DATE_ICAL, strtotime($event['te']['edate'])) . "
DESCRIPTION:" . $desc . "
X-ALT-DESC;FMTTYPE=text/html:" . $desc . "
LOCATION:" . $event['te']['location'] . "
END:VEVENT\r\n";
endforeach;
// close calendar
$output .= "END:VCALENDAR";
In addition to the new line issue, I'd like to put a link in the description. Hoping a solution will be valid and function in Apple Calendar, Google and Outlook.
ics output
BEGIN:VCALENDAR
METHOD:PUBLISH
VERSION:2.0
PRODID:-//App, Inc.//Calendar//EN
X-WR-TIMEZONE:America/Los_Angeles
CALSCALE:GREGORIAN
BEGIN:VEVENT
ORGANIZER;CN=BB:MAILTO:[email protected]
DTSTAMP:20180208T150517Z
SUMMARY:Committee Meeting
UID:200893236
DTSTART:20180208T170000Z
DTEND:20180208T180000Z
DESCRIPTION:Adding event to your schedule does not confirm your reservation.\nVisit http://www.website.com for attendance details.
X-ALT-DESC;FMTTYPE=text/html:Adding event to your schedule does not confirm your reservation.\nVisit http://www.website.com for attendance details.
LOCATION:Conference Room
END:VEVENT
END:VCALENDAR
Appreciate any guidance! Many forums are 5-8 years old on this topic so hoping for something current.