This course is still being released! Check back later for more chapters.
Mailer and Webhook with Mailtrap
Master sending and tracking stylish emails in Symfony & Mailtrap.
- intermediate
- 399 students
- EN/ES Captions
- EN/ES Script
- Certificate of Completion
Your Guides
About this course
Note
This course is free as it's sponsored by Mailtrap. See our blog post for more details on our partnership.
Yes, sooner or later, you'll need to send emails from your app! Maybe it's a Thanks for signing up! email, Your order is ready! email, or even a We think you're fabulous, here's a discount! email. Whatever the case, with Symfony's Mailer component and Mailtrap, sending emails can be both fun in development and simple & reliable on production. In this tutorial, we'll supercharge your emails by mastering Symfony's Mailer + testing and going to production with Mailtrap:
- Installing & configuring Symfony Mailer.
- Previewing sent emails easily with the Symfony profiler and Mailtrap's Test Tool.
- Using Twig to add HTML to your emails.
- Including and inlining CSS styles in your emails.
- Integrating the Foundation CSS framework with Inky.
- Adding attachments, embedded images, and setting a global "from" address.
- Tags and metadata for tracking and organizing your emails.
- Adding email assertions to your functional tests.
- Async email sending to keep responses speedy.
- Setting up production delivery with Mailtrap's bridge.
- Send emails from the command line.
And then... we'll dive into email tracking and webhooks!
- Configuring Symfony Webhook to capture every open, click, and bounce.
- Setting up Mailtrap's routing, parsing, and event consumer.
- Testing your webhook setup locally with Mailtrap and ngrok.
So, let's get those emails flying, looking great, and tracking like a charm.
Next courses in the Symfony 7: Learn More Tricks section of the Symfony 7 Track!
15 Comments


Is this sponsored by Mailtrap? If so, it should be explicitly stated. If not, it would still be helpful to clarify, as it is somewhat ambiguous. I'm curious whether you chose to feature Mailtrap because you think it is the most efficient service for handling mail in development mode with Symfony framework or if there is some form of partnership involved.
Hey @BigBenJr!
You're right, Mailtrap did sponsor this course. This enabled us to make it free and also some contributions to Symfony itself to improve the Webhook component (which benefits everyone). See our blog post on this for more details.
We'll add a note to the course description to make this clear.
Thanks!
Kevin
Hey @BigBenJr!
I'm glad you asked this! We should absolutely disclose partnerships. We'll add it here and in the future. That being said, we only create tutorials (sponsored or not) for tech that we use or would use if we have the use-case). We think Mailtrap is awesome.
Thanks for keeping us honest Ben!


Thanks for the clarification and for the high-quality tutorials (sponsored or not)! You make the learning curve feel effortless.
A good course with a subject that can become quite difficult in terms of compatibility.
But Foundation in 2025 😱
Hey @Ruslan
Nice try =) You know writing some clients is a pretty complex task, and it will not fit in any course. I bet there are libraries and that is not required to do by yourself. However, we register your idea in the backlog =)
Cheers!
I mean not "full" client, may be console command for some tasks like:
- Connect by IMAP
- Check IMAP folder
- Find email by part of header , get sender, connect to specific folder (spam, inbox, ..)
- Delete email or something else.
It's helpful task for mailing - FBL (Feed Back Loops) control email.
BR.
Hey @David-B,
I don't think it will include this. symfony/mailer
is for transactional emails only which don't require an unsubscribe link.


It would be great if you could include how to create dynamic transports aside from the one configured in the configuration. I think this helps with developers who are creating SaaS applications that need to set the transports for the mail service dynamically.
Thank you.
I waiting for something like this course.