Событие календаря sendgid не отображается - PullRequest
0 голосов
/ 13 июля 2020

Все, я использую php и SendGrid для отправки приглашений календаря на веб-сайте, но события, которые не отображаются, прикрепляются к загрузке.

$url = 'https://api.sendgrid.com/';

//$attachment.set_type("text/calendar");

$fileName = 'ics.ics';
$filePath = dirname(__FILE__);

$params = array(
'api_user'  => "xxxxxxxxxxxxxxxxxx",
'api_key'   => "xxxxxxxxxxxxxxxx",
'to'        => 'xxxxxxxxxxxxx@mail.com',
'subject'   => 'test of file sends',
'html'      => '<p> the HTML </p>',
'text'      => 'the plain text',
'from'      => 'systemadmin@example.com',
'type'      => 'calender',
'files['.$fileName.']' => '@'.$filePath.'/'.$fileName
);

$request =  $url.'api/mail.send.json';
$session = curl_init($request);

curl_setopt ($session, CURLOPT_POST, true);

// Tell curl that this is the body of the POST
curl_setopt ($session, CURLOPT_POSTFIELDS, $params);

// Tell curl not to return headers, but do return the response
curl_setopt($session, CURLOPT_HEADER, true);
// Tell PHP not to use SSLv3 (instead opting for TLS)
curl_setopt($session, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($session);
curl_close($session);

отображается так электронная почта

...