ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
Sending and Testing
Mails in Symfony
Christoph Hautzinger
@chautzi // christoph-hautzinger.de
#webdevbbq, 09.06.2015
@chautzi - hugh!?
? Webdev half of my live!
? Symfony 9 years
? diginights
? Fressnapf
? wetter.com
? ampya.com
? *.conspecton.com
? @conspecton Founder
? looking for a job? ;)
? Freelancing
Sending and Testing Mails in Symfony
Sending Mails
Status Quo
http://symfony.com/doc/current/cookbook/email/email.html
Disadvantages
? All parts of the mail reside in different places
? I18N?
? Code duplication
? Tight coupling
? 20 LOC!?
HautziSystemMailBundle
https://packagist.org/packages/hautzi/system-mail-bundle
https://github.com/christoph-hautzinger/SystemMailBundle
http://knpbundles.com/christoph-hautzinger/SystemMailBundle
How to use?
Additional stuff :-)
DDD Approach
thanks for the code!
Testing Mails
Status Quo
? Unit Tests
? In your domain, mock interfaces
? Functional Tests
? the pro?ler knows everything (when enabled)
? but writing functional tests in Symfony is not fun!
codeception
http://codeception.com/
mailcatcher
http://mailcatcher.me/
? provides simple smtp mail server
? default smtp://127.0.0.1:1025
? exposes simple mailclient gui
? default http://127.0.0.1:1080
? REST API to control everything
? http://127.0.0.1:1025
$ gem install mailcatcher
$ mailcatcher --ip=0.0.0.0
Sending and Testing Mails in Symfony
con?guring Symfony
also very useful in dev environment!
combine
codeception and mailcatcher
https://github.com/captbaritone/codeception-mailcatcher-module
Thank you!
Q&A
@chautzi
ºÝºÝߣs available at http://christoph-hautzinger.de

More Related Content

Sending and Testing Mails in Symfony