Yii 2 Mailer Tutorial
This Yii 2 mailer tutorial implements a method to send response messages via email to users of the application. This is sometimes called an auto-responder.
This tutorial is not included in my book, Yii 2 For Beginners, but I thought it would make a great addition to the template that the book builds.
This is not a short tutorial, even though in reality, there isn’t much code. The reason is that we are not only going to talk about how we are approaching our methods, but also why. The why is very important.
A couple of years ago, I discovered a youtube video that talks about how important “why” is, and ever since then, I’ve made it part of my lesson plans.
Also, my blog is geared toward beginners, so I take great pains to explain in great detail what we are doing, what decisions we made, and why we made them. We want to not only advance your understanding of Yii 2, but we also want to learn a little about design principles and their application.
The goal, as always, is to make the final code as pretty, thin, and usable as possible. Ultimately, the email trigger method will be in a controller, so we always want to keep that code as clean as possible.