public function sendNotifications($app_id, $from, $to, $subject, $body, $cc = null, $bcc = null, $attachments = null)
 {
     if (!is_array($to)) {
         $to = array();
     }
     $getFriends = Api_Dao_Friends::friendsGetFriends($from->id);
     $toids = array();
     foreach ($to as $to_user) {
         $toids[] = $to->id;
     }
     $sendFriends = array_intersect($toids, $getFriends);
     if (count($sendFriends) > 0) {
         $mailid = Api_Dao_Notification::createMail($uid, $subject);
         // If uid sends email to others, are they really in the thread yet?  only when response exists?
         foreach ($sendFriends as $friend) {
             Api_Dao_Notification::addUserToMail($mailid, $friend);
         }
         Api_Dao_Notification::addMessage($mailid, $uid, $notification, 0);
     }
 }
Пример #2
0
 /**
  * Enter description here...
  *
  * @param unknown_type $mailid
  * @param unknown_type $uid
  * @return unknown
  */
 public static function addUserToMail($mailid, $uid)
 {
     return Api_Dao_Notification::addUserToMail($mailid, $uid);
 }