-
-
Notifications
You must be signed in to change notification settings - Fork 860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tec: Provide a Minz_Mailer class #2476
Conversation
The `_path` method is more powerful since it allows to choose the file extension. It is also Minz_Request-agnostic, which is useful to reuse the Minz_View class in other places. `change_view` is now deprecated and a warning is logged if we use it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty straightforward. Btw, phpcs has a couple of minor formatting complaints. ;-)
c3cc53d
to
d43665b
Compare
Indeed! I just disabled the linter on the |
For some reason, when PHPMailer has a problem, it creates a file under |
It uses PHPMailer under the hood and only supports PHP >= 5.5
d43665b
to
e39671a
Compare
Fixed, it's just that I don't know how to concatenate two strings in PHP :D (I used a |
It's probably because with |
@marienfressinaud what's the status of this PR? Is it ready to be merged into dev? |
* Add Minz_View::_path method (replace change_view) The `_path` method is more powerful since it allows to choose the file extension. It is also Minz_Request-agnostic, which is useful to reuse the Minz_View class in other places. `change_view` is now deprecated and a warning is logged if we use it. * Provide a Minz_Mailer to send emails It uses PHPMailer under the hood and only supports PHP >= 5.5
This class can be inherited to create Mailers dedicated to some specific tasks. You can have an example of how to use it with what I've done to send validation emails (here and here). It is inspired by how Rails works with emails.
My main concern with this code is that the calls to the SMTP server need to be finished before redirecting the user. We have no systems of parallel queues. But it may be not critical yet and we can go with it for the moment… ?
I also needed to change the
Minz_View
API a bit by replacing thechange_view
method by a_path
one. It is nowMinz_Request
-agnostic and can support files different than thephtml
ones.To merge in
--no-ff