Chapters
47 Chapters
|
4:41:51
|
Login to bookmark this video
-
Course Code
Subscribe to download the code!
Subscribe to download the code!
-
This Video
Subscribe to download the video!
Subscribe to download the video!
-
Subtitles
Subscribe to download the subtitles!
Subscribe to download the subtitles!
-
Course Script
Subscribe to download the script!
Subscribe to download the script!
Scroll down to the script below, click on any sentence (including terminal blocks) to jump to that spot in the video!
Subscribe to jump to this part in the video!
Keep on Learning!
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
¡Este tutorial también funciona muy bien para Symfony 6!
What PHP libraries does this tutorial use?
// composer.json
{
"require": {
"php": ">=8.2",
"ext-ctype": "*",
"ext-iconv": "*",
"babdev/pagerfanta-bundle": "^3.3", // v3.3.0
"composer/package-versions-deprecated": "^1.11", // 1.11.99.4
"doctrine/annotations": "^1.0", // 1.13.2
"doctrine/doctrine-bundle": "^2.1", // 2.6.3
"doctrine/doctrine-migrations-bundle": "^3.0", // 3.1.1
"doctrine/orm": "^2.7", // 2.10.1
"knplabs/knp-markdown-bundle": "^1.8", // 1.9.0
"knplabs/knp-time-bundle": "^1.11", // v1.16.1
"pagerfanta/doctrine-orm-adapter": "^3.3", // v3.3.0
"pagerfanta/twig": "^3.3", // v3.3.0
"phpdocumentor/reflection-docblock": "^5.2", // 5.2.2
"scheb/2fa-bundle": "^5.12", // v5.12.1
"scheb/2fa-qr-code": "^5.12", // v5.12.1
"scheb/2fa-totp": "^5.12", // v5.12.1
"sensio/framework-extra-bundle": "^6.0", // v6.2.0
"stof/doctrine-extensions-bundle": "^1.4", // v1.6.0
"symfony/asset": "5.3.*", // v5.3.4
"symfony/console": "5.3.*", // v5.3.7
"symfony/dotenv": "5.3.*", // v5.3.8
"symfony/flex": "^1.3.1", // v1.21.6
"symfony/form": "5.3.*", // v5.3.8
"symfony/framework-bundle": "5.3.*", // v5.3.8
"symfony/monolog-bundle": "^3.0", // v3.7.0
"symfony/property-access": "5.3.*", // v5.3.8
"symfony/property-info": "5.3.*", // v5.3.8
"symfony/rate-limiter": "5.3.*", // v5.3.4
"symfony/runtime": "5.3.*", // v5.3.4
"symfony/security-bundle": "5.3.*", // v5.3.8
"symfony/serializer": "5.3.*", // v5.3.8
"symfony/stopwatch": "5.3.*", // v5.3.4
"symfony/twig-bundle": "5.3.*", // v5.3.4
"symfony/ux-chartjs": "^1.3", // v1.3.0
"symfony/validator": "5.3.*", // v5.3.8
"symfony/webpack-encore-bundle": "^1.7", // v1.12.0
"symfony/yaml": "5.3.*", // v5.3.6
"symfonycasts/verify-email-bundle": "^1.5", // v1.5.0
"twig/extra-bundle": "^2.12|^3.0", // v3.3.3
"twig/string-extra": "^3.3", // v3.3.3
"twig/twig": "^2.12|^3.0" // v3.3.3
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.3", // 3.4.0
"symfony/debug-bundle": "5.3.*", // v5.3.4
"symfony/maker-bundle": "^1.15", // v1.34.0
"symfony/var-dumper": "5.3.*", // v5.3.8
"symfony/web-profiler-bundle": "5.3.*", // v5.3.8
"zenstruck/foundry": "^1.1" // v1.13.3
}
}
11 Comments
Hey there!
I'm glad it was useful!
> it seems there isn't functionality regarding resending the verification email after expiration. There seems some open issues (#35, #50) for this enhancement in the repo, but there hasn't been an update on those yet. Do you think such functionality will be added to the bundle in the near future or do we need to implement it ourselves?
I'm not sure. jrushlow helps me maintain that bundle, but we're all pretty busy. The ideal situation would be if someone from the community could add it. But, we have an internal OSS issue tracker, and I'll add this to it :). I agree that it really IS something the bundle needs.
Cheers!
I was needed to "verify email" functionality and at 6:27 on the video where Ryan has made a shortcut of FLASH message instead of sending email I was a little upset.
And I really began to prepare for learning the "Symfony Mailer: Love Sending Emails Again" course.
But when I was exploring the other courses, I found a brilliant =)
There is an extension for this functionality with exactly this code in "What's new in Symfony6" course.
Here is the link with video of sending emails: https://symfonycasts.com/screencast/symfony6-upgrade/docker
Maybe it will be helpful if you need a quick explanation how to send emails.
Thank you, Ryan. Again... =)
Hey @Magnoom Thanks for sharing it with others. Cheers!
I am trying to use an actual email verification while registering. To make things simple, I have chosen to use a verification email right in the registration form maker.
In the the register controller, in the register function, I have a call to
$this->emailVerifier->sendEmailConfirmation. ThesendEmailConfirmationdoes use$this->mailer->send($email);, which I guess, sends the email.As the email sending provider, I have chose Brevo and downloded the corresponding bundle. In the
.envfile. I have setMAILER_DSNtobrevo+api://KEY@defaultwhere I have replace KEY by my Brevo API key. I have not received any email and, as a matter of fact, the created user has ais_verifiedkey set to 0.Should I modify
@defaultin the MAILER_DSN entry?At this stage, I am rather confused. I have had a look at the Sfcast course on the symfony mailer, bur it seems that in the course an actual email is never sent (it uses a bogus email service). Since I do not get the confirmation email for real, I cannot check if the verification link works.
TIA,
François
Hey Francois,
Make sure you send emails sync and not async. If you have async emails sending - the email messages most probably hit your message queue, and in this case you would need to run the Messenger worker to consume those messages from the queue and actually send them.
Also, for email debugging purposes, you can leverage Mailtrap service... or some software that you can spin locally like Mailcatcher or MailHog. With this you would not need to use paid services like Brevo to actually send emails for debugging.
Cheers!
Thanks!
Things worked after setting the following line in the
messenger.yamlfile:BTW, at Brevo, the free plan lets you send 300 emails per day, which lets you do some testing without credit card
Have a good day!
Hey Francois,
Yeah, making that sync should simplify things locally. Instead of doing it for specific messages, you can do it globally by setting the
MESSENGER_TRANSPORT_DSN=sync://- then all your async messages will work sync - easier for debugging locally :)And yeah, a free plan with some limitations is useful too :)
Cheers!
Can you please tell me how to debug and change as example token_expiration ?
Hey Mepcuk@
You want to change the lifetime of the token expiration? I realize that we don't document this! At your command line, run:
That should dump the example config that's allowed for this bundle. You'll find that you can (in any YAML file in config/packages - so just create a new one) say:
Let me know if this is what you were looking for :).
Cheers!
Hi, I have an issue with this function : verifyUserEmail.
I don't know how write this code:
$user = $userRepository->find();
$request->query->get('id');
OR
$user = $userRepository->find($request->query->get('id'));
Can someone help me please ?
Louis G.
Hey Louis Gellez!
The second is correct:
The
$request->query->get('id')returns the string ?id" query parameter (e.g. if the URL ended in ?id=5, this would return "5"). Then this is passed to the find() method, which finds the User with that id. You'll find this exact code in the "finish" directory of the code download. And once we record this chapter (actually I moved this content to the NEXT chapter today - https://symfonycasts.com/screencast/symfony-security/verify-signed-url ) then you will be able to see it clearly in the code blocks.Cheers!
"Houston: no signs of life"
Start the conversation!