1

我正在用 PHP 构建一个事件管理 Web 应用程序,并且正在使用 Google Data API 来使用 Google 日历。

我使用以下方法添加了客人:

$gc = new Zend_Gdata_Calendar($client);
$newEntry = $gc->newEventEntry();
$newEntry->who=array($gc->newWho('abc@gmail.com'));

我想向添加的客人发送邮件以通知他们该事件。(此功能在 Google 日历 UI 中提供)。

我怎样才能做到这一点?

4

1 回答 1

0

这可能会有所帮助:

公共函数 sendInvite($eventId, $email)
{
    $gdataCal = new Zend_Gdata_Calendar($this->client);

    if($eventOld = $this->getEvent($eventId))
    {
        $SendEventNotifications = new Zend_Gdata_Calendar_Extension_SendEventNotifications();
        $SendEventNotifications->setValue(true);
        $eventOld->SendEventNotifications = $SendEventNotifications;
        $who = $gdataCal->newwho();
        $who->setEmail($email);

        $eventOld->setWho(array_merge(array($w​​ho), $eventOld->getWho()));

        尝试
        {
            $eventOld->save();
        } 捕捉(Zend_Gdata_App_Exception $e)
        {
            返回假;
        }

        返回真;
    } 别的
        返回假;
}
于 2011-11-25T11:48:21.737 回答