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.
Frenzie
left a comment
There was a problem hiding this comment.
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? |
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_ViewAPI a bit by replacing thechange_viewmethod by a_pathone. It is nowMinz_Request-agnostic and can support files different than thephtmlones.To merge in
--no-ff