Today, I gave a talk at #webdevbbq in Stuttgart, Germany about how to send and test mail delivery in Symfony.
Here are the slides:
I don’t like the approach the Symfony documentation suggests how to send mails in Symfony:
From my point of view, there are several drawbacks:
To address those points, I created a small bundle called HautziSystemMailBundle:
— Christoph Hautzinger (@chautzi) May 13, 2015
With this bundle, it is very simple to define your system-mails in an xml structure like this:
and with the help of twig, everything gets really powerful:
to send out those mail-definitions, your controller now looks like this:
Of course – in a DDD world, you should not send emails within an controller by default, but this blog post is only for demonstrating the capabilities of this bundle.
If you like this approach, you can find further information about its installation or some more examples on the github page of this bundle.
Feedback welcome :)