public function emailWinner($sweepstakeId, $userId)
 {
     $this->sweepstakeId = $sweepstakeId;
     $this->setCurrentState(self::$STATE__EMAIL_SENT);
     $sweepstakeData = Sweepstake_table::getSweepstakeById($this->sweepstakeId);
     $userFbData = FbUser_table::getUser($userId);
     mail($userFbData["email"], "You become winner in " . $sweepstakeData["title"], $sweepstakeData["winner_message"], "Content-type: text/html; charset=UTF-8");
 }
 public function registerEmail($sweepstakeId, $userId, $email)
 {
     $this->setCurrentState(self::$STATE__REGISTER_EMAIL);
     $this->userId = $userId;
     $this->sweepstakeId = $sweepstakeId;
     FbUser_table::updateData($this->userId, array("email" => $email));
 }