title: Symfony2: check-email after registration
body: <p>First time I'm posting a message in this forum, which I use regularly. I use FOSUserbundle in my Symfony2 application to manage users. I activated the sending of the email confirmation when users create an account by the following thing:</p>
  
  <pre><code>fos_user:
      registration:
          confirmation:
              enabled:    true
  </code></pre>
  
  <p>It works very well: the email is sent successfully. I am redirected to the page /check-email that says that this email has been sent. However, I would like to change the redirection : I would like to be redirected to my index page and not to /check-email. So I did my research and I knew he had to go through the FOSUserBundle events (<a href="https://github.com/FriendsOfSymfony/FOSUserBundle/blob/master/FOSUserEvents.php" rel="nofollow">list here</a>).</p>
  
  <p>What I did : </p>
  
  <pre><code>class RegistrationListener implements EventSubscriberInterface {
  
  private $router;
  
  public function __construct(UrlGeneratorInterface $router) {
      $this-&gt;router = $router;
  }
  
  public static function getSubscribedEvents() {
      return array(
              FOSUserEvents::REGISTRATION_CONFIRM =&gt; 'onRegistrationConfirm');
  }
  
  public function onRegistrationConfirm(FormEvent $event) {
      $url = $this-&gt;router-&gt;generate('listeArticlesAccueil');
      $event-&gt;setResponse(new RedirectResponse($url));
  }
  </code></pre>
  
  <p>}</p>
  
  <p>and services.yml</p>
  
  <pre><code>services: 
      listener_user.registration_listener:
          class: My\Soft\UserBundle\EventListener\RegistrationListener
          arguments: [@router]
          tags:
              - { name: kernel.event_subscriber }
  </code></pre>
  
  <p>The problem is that every time I am redirected to the page /check-email. I therefore told me that it was probably the wrong event. So I also tried REGISTRATION_SUCCESS. But nothing changes. So either I have not used the right event, or I'm doing something wrong.</p>
  
  <p>In either case, I hope you can help me !</p>
  
  <p>Thanks a lot and sorry for my bad english ;)</p>