예제 #1
0
 public function sendActivationMail($user)
 {
     $activation = new Activation();
     $activation->setSfGuardUser($user);
     $key = sha1($user->getUsername() . time());
     $activation->setActivationKey($key);
     $activation->save();
     $message = $this->getMailer()->composeAndSend('*****@*****.**', $user->getEmailAddress(), 'Please confirm your registration!', 'Hello ' . $user->getName() . ',
     Please click on the following link to complete your registration:
     ' . $this->generateUrl('register_activation', array('activation_key' => $activation->getActivationKey()), true) . '
     We hope you will have fun!');
     $this->getUser()->setFlash('notice', 'Un mail de confirmation vous a été envoyé !');
     $this->redirect('@homepage');
 }