是否有标准和实施Icalendar事件RSVP [英] Is there a standard and an implementation for Icalendar event RSVP

查看:225
本文介绍了是否有标准和实施Icalendar事件RSVP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

总结是我正在实施事件确认系统,找不到ICalendar回复的正确格式。因此,我想知道是否有一个完整的REPLY消息的例子,也许一个可以包装所有的PHP库?



现在详细说明,我们收到外部电子邮件,包括事件邀请请求RSVP。以下是iCal文件的摘录:



ATTENDEE; ROLE = REQ-PARTICIPANT; PARTSTAT = NEEDS-ACTION; RSVP = TRUE; CN = 'user@company.com':MAILTO:user@company.com
ORGANIZER; CN =Organ Izer:MAILTO:organizer@company.com



我找不到回复标准将RSVP发送给组织者。 RFC 2447 提到了ATTSTAT和PARTSTAT参数。



通过尝试将以下消息发送到Google日历,该活动尚未更新。

  $ headers =Content-Type:text / calendar; Content-Disposition:inline; charset = utf-8; \r\\\
;
$ headers。=Content-Type:text / plain; charset = \utf-8\\r\\\
;
$ headers。='BEGIN:VCALENDAR
VERSION:2.0
方法:REPLY
BEGIN:VEVENT
ORGANIZER; CN = JCharles:mailto:abcdef@gmail.com
UID:oc7ae7537999onscsivg8km123@google.com
ATTENDEE; CUTYPE = INDIVIDUAL; ROLE = REQ-PARTICIPANT; PARTSTAT = CONFIRMED; RSVP =
TRUE; CN=jc@company.se; X-NUM -GUESTS = 0:mailto:jc@company.se
位置:
SEQUENCE:1
END:VEVENT
END:VCALENDAR';

mail('abcdef@gmail.com','Accepted:',接受事件,$ headers);

Ical消息或方法本身有什么问题吗?这是事件答复应该发送的方式吗?

解决方案

以下代码将与谷歌日历一起使用。附件由gmail处理,验收级联到该事件。

  $ vcal ='BEGIN:VCALENDAR 
PRODID :// // Example.NU//SE
VERSION:2.0
CALSCALE:GREGORIAN
方法:回复
开始:VEVENT
DTSTART:20101215T160000Z
DTEND :20101215T170000Z
DTSTAMP:'。date('Ymd\THis\Z')'
ORGANIZER; CN = Jean-Charles:mailto:example@gmail.com
UID:u2coh5g3bppo2d2o3t @ google.com
ATTENDEE; CUTYPE = INDIVIDUAL; ROLE = REQ-PARTICIPANT; PARTSTAT = ACCEPTED;
CN=user@example.se:mailto:user@example.se
CREATED:19000101T120000Z
描述:äåóö
最近修改:'。date('Ymd\This '
位置:
SEQUENCE:0
状态:确认
摘要:新测试
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR
';

$ vcal = utf8_encode($ vcal);

require('lib / phpmailer / class.phpmailer.php');
$ mail = new PHPMailer();
$ mail-> AddAddress('example@gmail.com','Jean-Charles');
$ mail-> Body =HTML BODY;
$ mail-> AltBody =文本正文;
$ mail-> Subject =电子邮件标题;
$ mail-> Sender =用户名;
$ mail-> FromName =user@example.se;
$ mail-> AddStringAttachment($ vcal,'meeting.ics','base64,text / calendar);
$ mail-> Send();

重要的位是




  • 内容类型:文本/日历

  • 方法:回复

  • PARTSTAT:ACCEPTED | DECLINED

  • UID



我不确定有必要发回所有冗余信息(description,summary,dtend,dtstart)


The summary is that I am now implementing an event confirmation system and can't find the right format for the ICalendar replies. Therefore I wonder if there is an example out there of complete REPLY message and maybe a PHP library that would wrap it all?

Now for the details, we get external emails including event invitations asking for RSVP. Here is an excerpt of the iCal file:

ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN="'user@company.com'":MAILTO:user@company.com ORGANIZER;CN="Organ Izer":MAILTO:organizer@company.com

I couldn't find the reply standard to send the RSVP to the organizer. The RFC 2447 mentions "ATTSTAT" and "PARTSTAT" parameter.

By trying to mail the following message to Google calendar the event is not being updated.

$headers = "Content-Type:text/calendar; Content-Disposition: inline; charset=utf-8;\r\n";
$headers .= "Content-Type: text/plain;charset=\"utf-8\"\r\n";
$headers .= 'BEGIN:VCALENDAR
VERSION:2.0
METHOD:REPLY
BEGIN:VEVENT
ORGANIZER;CN=JCharles:mailto:abcdef@gmail.com
UID:oc7ae7537999onscsivg8km123@google.com
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=CONFIRMED;RSVP=
 TRUE;CN=jc@company.se;X-NUM-GUESTS=0:mailto:jc@company.se
LOCATION:
SEQUENCE:1
END:VEVENT
END:VCALENDAR';

mail('abcdef@gmail.com', 'Accepted:', "Event accepted", $headers);

Is there anything wrong with the Ical message or with the method in itself? Is this the way the event replies are supposed to be sent?

解决方案

The following code will work with google calendar. The attachment is processed by gmail and acceptance is cascaded to the event.

$vcal = 'BEGIN:VCALENDAR
PRODID:-//EXAMPLE.NU//SE
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:REPLY
BEGIN:VEVENT
DTSTART:20101215T160000Z
DTEND:20101215T170000Z
DTSTAMP:'.date('Ymd\THis\Z').'
ORGANIZER;CN=Jean-Charles:mailto:example@gmail.com
UID:u2coh5g3bppo2d2o3t@google.com
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;
 CN=user@example.se:mailto:user@example.se
CREATED:19000101T120000Z
DESCRIPTION:äåóö
LAST-MODIFIED:'.date('Ymd\THis\Z').'
LOCATION:
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:a new test
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR
';

$vcal = utf8_encode($vcal);

require('lib/phpmailer/class.phpmailer.php');
$mail = new PHPMailer();
$mail->AddAddress('example@gmail.com', 'Jean-Charles');
$mail->Body = "HTML BODY";
$mail->AltBody = "Text body";
$mail->Subject = "Email title";
$mail->Sender = "User Name";
$mail->FromName = "user@example.se";
$mail->AddStringAttachment($vcal, 'meeting.ics', "base64", "text/calendar");
$mail->Send();

The important bits are

  • Content-type : text/calendar
  • METHOD:REPLY
  • PARTSTAT:ACCEPTED|DECLINED
  • UID

I am not sure that it is necessary to send back all redundant information (description, summary, dtend, dtstart)

这篇关于是否有标准和实施Icalendar事件RSVP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆