Exemplo n.º 1
0
 /**
  * Notify the user of the activated account.
  *
  * @param sfGuardUser $user
  */
 private function notifyNewPassword(sfGuardUser $user, $password)
 {
     //        $message = Swift_Message::newInstance()
     //          ->setFrom(sfConfig::get('app_sf_guard_plugin_default_from_email', '*****@*****.**'))
     //          ->setTo($this->user->email_address)
     //          ->setSubject('New Password for '.$this->user->username)
     //          ->setBody($this->getPartial('sfGuardForgotPassword/new_password', array('user' => $this->user, 'password' => $request['sf_guard_user']['password'])))
     //        ;
     //
     //        $this->getMailer()->send($message);
     $vars = array('user' => $user, 'password' => $password);
     $message_html = $this->getPartial('rtGuardForgotPassword/email_new_password_html', $vars);
     $message_html = $this->getPartial('rtEmail/layout_html', array('content' => $message_html));
     $message_plain = $this->getPartial('rtGuardForgotPassword/email_new_password_plain', $vars);
     $message_plain = $this->getPartial('rtEmail/layout_plain', array('content' => html_entity_decode($message_plain)));
     $message = Swift_Message::newInstance()->setFrom($this->getAdminEmail())->setTo($user->getEmailAddress())->setSubject('New Password for ' . $user->username)->setBody($message_html, 'text/html')->addPart($message_plain, 'text/plain');
     $this->getMailer()->send($message);
 }
 /**
  * Merge a users data with that from Facebook, updating fields where
  * appropriate
  *
  * @param   array       $facebookUserInfo
  * @param   sfGuardUser $user
  * @return  self
  */
 public function mergeFacebookInfo(array $facebookUserInfo, sfGuardUser $user)
 {
     if (!$this->getUserSetName()) {
         if (isset($facebookUserInfo['name']) && $this->getFullName() != $facebookUserInfo['name']) {
             $this->setFullName($facebookUserInfo['name']);
         }
         if (isset($facebookUserInfo['first_name']) && $user->getFirstName() != $facebookUserInfo['first_name']) {
             $user->setFirstName($facebookUserInfo['first_name']);
         }
         if (isset($facebookUserInfo['last_name']) && $user->getLastName() != $facebookUserInfo['last_name']) {
             $user->setLastName($facebookUserInfo['last_name']);
         }
     }
     if (!$this->getUserSetEmailAddress()) {
         $email = isset($facebookUserInfo['email']) ? $facebookUserInfo['email'] : '';
         if (sfConfig::get('app_facebook_dont_store_proxy_emails', false)) {
             if (sfFacebookGraph::checkProxyEmail($email)) {
                 $email = '';
             }
         }
         if ($email != $user->getEmailAddress()) {
             $user->setEmailAddress($email);
         }
     }
     return $this;
 }
Exemplo n.º 3
0
 public function generateVerificationToken(sfGuardUser $user)
 {
     $this->setVerificationToken(MicroId::generate('mailto:' . $user->getEmailAddress(), $this->getDomain()));
 }
 /**
  * Notify the user of the activated account.
  *
  * @param sfGuardUser $user
  */
 protected function notifyUser(sfGuardUser $user, $password = null)
 {
     $vars = array('user' => $user);
     if (isset($password)) {
         $vars['password'] = $password;
     }
     $message_html = $this->getPartial('rtGuardRegister/email_registration_success_html', $vars);
     $message_html = $this->getPartial('rtEmail/layout_html', array('content' => $message_html));
     $message_plain = $this->getPartial('rtGuardRegister/email_registration_success_plain', $vars);
     $message_plain = $this->getPartial('rtEmail/layout_plain', array('content' => html_entity_decode($message_plain)));
     $message = Swift_Message::newInstance()->setFrom($this->getAdminEmail())->setTo($user->getEmailAddress())->setSubject('Registration confirmed!')->setBody($message_html, 'text/html')->addPart($message_plain, 'text/plain');
     $this->getMailer()->send($message);
 }