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; }
/** * 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(); }