/** * Send mail to selected users * @global ilObjUser $ilUser */ protected function distributeUserNotifications() { global $ilUser; include_once './Services/Calendar/classes/class.ilCalendarMailNotification.php'; $notification = new ilCalendarMailNotification(); $notification->setAppointmentId($this->app->getEntryId()); foreach ($this->notification->getRecipients() as $rcp) { switch ($rcp['type']) { case ilCalendarUserNotification::TYPE_USER: $notification->setSender(ANONYMOUS_USER_ID); $notification->setRecipients(array($rcp['usr_id'])); $notification->setType(ilCalendarMailNotification::TYPE_USER); break; case ilCalendarUserNotification::TYPE_EMAIL: $notification->setSender(ANONYMOUS_USER_ID); $notification->setRecipients(array($rcp['email'])); $notification->setType(ilCalendarMailNotification::TYPE_USER_ANONYMOUS); break; } $notification->send(); } }