.ics file HTML in description for Outlook Client (desktop) in PHP

139
June 01, 2022, at 7:10 PM

I have been going round in circles with this one trying to get HTML to show up in outlook using a .ics file.

I know this has been asked and answered before using the X-ALT-DESC tag but outlook seems to completely ignore it and only take the description tag.

This is the contents of the generates ics file:

BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
DTSTART:20220214T124600Z
DTEND:20220214T134600Z
SUMMARY:A Title Event
DESCRIPTION:Some Event: Link Text
X-ALT-DESC;FMTTYPE=text/html:<!DOCTYPE html><html><body>Some <em>other</em> Event: <a href="https://google.com">Link Text</a></body></html>
LOCATION:
END:VEVENT
END:VCALENDAR

As you can see, I have both the pail text DESCRIPTION tag and the X-ALT_TAG;FMTTYPE=text/html tags and yet with that, only the description tag is used.

Here is the code used to generate the file:

    $query = [
      'BEGIN:VCALENDAR',
      'VERSION:2.0',
      'BEGIN:VEVENT',
      sprintf('DTSTART:%s', $params['start']->format($dateFormat)),
      sprintf('DTEND:%s', $params['end']->format($dateFormat)),
      sprintf('SUMMARY:%s', $params['title']),
      sprintf('DESCRIPTION:%s', strip_tags($params['description'])),
      sprintf('X-ALT-DESC;FMTTYPE=text/html:<!DOCTYPE html><html lang="en"><body>%s</body></html>\r\f', $params['description_html']),
      sprintf('LOCATION:%s', $params['location']),
      'END:VEVENT',
      'END:VCALENDAR',
    ];
    return sprintf('data:text/calendar;filename=iCal.ics;charset=utf8,%s', rawurlencode(implode("\r\n", $query)));

Can anyone tell me what I am doing wrong, or is X-ALT-DESC just no longer supported in 2022?

Rent Charter Buses Company
READ ALSO
How can we create a separate log files for all the levels by Monolog module Drupal9?

How can we create a separate log files for all the levels by Monolog module Drupal9?

How can we create a separate log files for all the levels by Monolog module Drupal9? EgINFO logs only in info file and Warning log in warning file?

117
How to Recursively find secondary profiles and merge into primary one

How to Recursively find secondary profiles and merge into primary one

I have a sample array, in which I would like to find the secondary ones and recursively check the secondary one until all secondary profiles gets unset from PHP arrayHere is the example array

72
How do I write my code in a way that when my containers are deployed as Rancher workloads they can communicate?

How do I write my code in a way that when my containers are deployed as Rancher workloads they can communicate?

I have been using Docker to containerise a simple PHP web app that connects to and uses a mySQL database to pull data fromIt also includes phpmyadmin as a UI for the management of the database

136
Invalid argument supplied for foreach()

Invalid argument supplied for foreach()

It often happens to me to handle data that can be either an array or a null variable and to feed some foreach with these data

124