i'm trying fire event when create calendar item (appointment) in exchange, using php-ews. currently, able fire event when email sent:
$subscribe_request = new \ewstype_subscribetype(); $pushsubscription = new \ewstype_pushsubscriptionrequesttype(); $pushsubscription->statusfrequency = 1; $pushsubscription->url = 'http://someserver/log.php'; $folderids = new \ewstype_nonemptyarrayofbasefolderidstype(); $eventtypes = new \ewstype_nonemptyarrayofnotificationeventtypestype(); $folderids->distinguishedfolderid = new \ewstype_distinguishedfolderidtype(); $folderids->distinguishedfolderid->id = \ewstype_distinguishedfolderidnametype::inbox; $eventtypes->eventtype = "newmailevent"; $pushsubscription->folderids = $folderids; $pushsubscription->eventtypes = $eventtypes; $subscribe_request->pushsubscriptionrequest = $pushsubscription; return $this->ews->subscribe($subscribe_request); log.php
class ewsservice { public function sendnotification($arg) { file_put_contents("c:\\exchangelogs\\log_".time().".txt", print_r($arg,1)); $result = new ewstype_sendnotificationresulttype(); $result->subscriptionstatus = 'ok'; //$result->subscriptionstatus = 'unsubscribe'; return $result; } } $opts = array(); $server = new soapserver( 'notificationservice.wsdl', array('uri' => 'http://someserver/log.php')); $server->setobject($service = new ewsservice()); $server->handle(); every minute 'keep alive message' sent , sendnotification function called. same thing happens when mail sent (using outlook or whatever).
this works fine.
however, want same when calendar item created, such appointment. tried changing distinguishedfolderidnametype calendar , eventtype createdevent, receive no message when appointment created.
any appreciated.
Comments
Post a Comment