Ejemplo n.º 1
0
 public function execute()
 {
     $response = array();
     // can only be sent to friends
     $friends = Api_Bo_Friends::getFriends($this->getUserId());
     $sendFriends = array_intersect($this->recipients, $friends);
     if (count($sendFriends) > 0) {
         // get Email address for each friend.
         $response['result'] = implode(",", $sendFriends);
         $mailid = Api_Bo_Notification::createMail($this->getUserId(), $this->subject);
         foreach ($sendFriends as $friend) {
             Api_Bo_Notification::addUserToMail($mailid, $friend);
         }
         Api_Bo_Notification::addMessage($mailid, $this->getUserId(), $this->message, 1);
         Api_Bo_Notification::sendEmail($this->getUserId(), $sendFriends, $this->subject, $this->message);
     }
     return $response;
 }
Ejemplo n.º 2
0
 /**
  *  notifications.get
  */
 public function execute()
 {
     Api_Bo_Notification::sendNotification($this->toids, $this->getUserId(), $this->subject, $this->notification, 0);
     // TODO: is this even needed?
     return array();
 }