protected function sendConfirmation($mailer, User $user)
 {
     $router = $this->getContainer()->get('router');
     $templating = $this->getContainer()->get('templating');
     $router->setContext(new RequestContext('', 'GET', 'www.gotchosen.com', 'https'));
     $params = ['token' => $user->getConfirmationToken()];
     $url = $router->generate('fos_user_resetting_reset', $params, true);
     $rendered = $templating->render('FOSUserBundle:Resetting:email.txt.twig', array('user' => $user, 'confirmationUrl' => $url));
     // Render the email, use the first line as the subject, and the rest as the body
     $renderedLines = explode("\n", trim($rendered));
     $subject = $renderedLines[0];
     $body = implode("\n", array_slice($renderedLines, 1));
     $message = \Swift_Message::newInstance()->setSubject($subject)->setFrom('*****@*****.**', 'GotChosen')->setTo($user->getEmail())->setBody($body);
     $mailer->send($message);
     $user->setPasswordRequestedAt(new \DateTime());
     $this->getContainer()->get('fos_user.user_manager')->updateUser($user);
 }