我正在使用PHP构建一个事件管理Web应用程序,并使用Google Data API来使用Google日历。
我添加了以下客人:
$gc = new Zend_Gdata_Calendar($client);
$newEntry = $gc->newEventEntry();
$newEntry->who=array($gc->newWho('abc@gmail.com'));
我想向添加的客人发送邮件以通知他们该活动。(Google日历用户界面中有此功能)。
我该怎么做?
答案 0 :(得分:0)
这可能会有所帮助:
public function 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($who), $eventOld->getWho())); try { $eventOld->save(); } catch(Zend_Gdata_App_Exception $e) { return false; } return true; } else return false; }