Framework PHP: Symfony2.6
Problem: I would like to add the following functionality to FosUserBundle: "The admin can re-send the registration confirmation email to a specific user" (in the admin section of the website).
I've already built the "user details" page where the admin can see all the information entered in the registration form and if the the user is enabled/confirmed. If the user is not enabled I will add a button to re-send the confirmation email.
Another solution is to to display a link to the user, after he tries to login with credentials that are not confirmed. Here is a similar question (that unfortunately has no feedback and it's not very clear to me and only covers the second approach):
https://stackoverflow.com/questions/25204877/re-sending-confirmation-email-fosuserbundleCan you please point me towards the easiest and quickest solution?
I know this an old question but today I came across the same problem and I found a simpler solution. Maybe this also helpful to others:
Simply ask the FOSUserBundle
for its mailer
and use it to re-send the message:
$mailer = $this->get('fos_user.mailer');
$mailer->sendConfirmationEmailMessage($user);
That's it! This will re-send an exact copy of the confirmation mail, since the same FOSUserBundle
code is used. No need to manually re-create the message.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With