Full course available at https://www.codereviewvideos.com/cour...
In this video we are going to look at how FOSUserBundle email templates can be customised, and also how to use Symfony's built in features to work with emails during development.
Configuration of email during development is not specific to FOSUserBundle, so the techniques you see here can be used in any Symfony development environment.
The email template customisations are specific to FOSUserBundle, however.
Before we go further, the majority of our testing for email inside a Symfony application that uses FOSUserBundle will involve visiting the /resetting/request route. When you have visited this route and filled in the form with a valid email address, an email will be sent to the given email address containing details on how to reset your password.
As part of this process, the User entity that relates to this email address will have the $passwordRequestedAt property updated to a DateTime instance of when the password reset was requested.
This will cause you an issue during testing, as once the password_requested_at field inside your database is no longer null, you cannot re-request a password reset for 24 hours. As such, be sure to keep your database client open and set the password_requested_at field back to null before testing the Password Reset workflow.
This is exactly the sort of thing that would be better managed through an automated test :)
However, it is also worthwhile having a secondary method - a simple contact form - on your real web site to allow Users to email you / your helpdesk directly, should something have gone wrong in the process, rather than making a User of your system wait 24 hours to be able to log back in.
https://codereviewvideos.com/course/g...
Watch video FOSUserBundle [8/15] - Email Management and Template Customisation online without registration, duration hours minute second in high quality. This video was added by user Code Review Videos 17 March 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 215 once and liked it 2 people.