Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FOSUserBundle Confirmation after registration

Tags:

symfony

I have activated in the FOSUserBundle the email confirmation. It allows users to receive a link by mail after they registration.

registration:
    confirmation:
        enabled: true

But It's not really what I want. I just want to send a welcome mail to confirm their registration (with no confirmation link).

Is it possible to configurate that in the FOSUserBundle?

like image 286
Kevin Avatar asked Jun 24 '26 10:06

Kevin


1 Answers

You can set a custom template for the email sent after registration:

confirmation:
    enabled:    true
    template:   YourUserBundle:Registration:email.txt.twig

Copy the default FOSUserBundle:Registration:email.txt.twig and remove the confirmation link.

But as the confirmation is set to true, your users will not be enabled by default.

So, if you want disable the whole confirmation feature, you can:

  • Override the FOS\UserBundle\Controller\RegistrationController to send a custom e-mail
  • Create a listener that send a custom e-mail onFOSUserEvents::REGISTRATION_CONFIRMED

Hope this helps.

like image 120
chalasr Avatar answered Jun 26 '26 19:06

chalasr



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!