Skip to content

tec: Provide a Minz_Mailer class#2476

Merged
Alkarex merged 2 commits intoFreshRSS:devfrom
flusio:tec/provide-minz-mailer
Aug 15, 2019
Merged

tec: Provide a Minz_Mailer class#2476
Alkarex merged 2 commits intoFreshRSS:devfrom
flusio:tec/provide-minz-mailer

Conversation

@marienfressinaud
Copy link
Copy Markdown
Member

@marienfressinaud marienfressinaud commented Aug 2, 2019

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 the change_view method by a _path one. It is now Minz_Request-agnostic and can support files different than the phtml ones.

To merge in --no-ff

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.
Copy link
Copy Markdown
Member

@Frenzie Frenzie left a 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. ;-)

@marienfressinaud marienfressinaud force-pushed the tec/provide-minz-mailer branch from c3cc53d to d43665b Compare August 2, 2019 21:35
@marienfressinaud
Copy link
Copy Markdown
Member Author

marienfressinaud commented Aug 2, 2019

Indeed! I just disabled the linter on the PHPMailer lib since it's not our code, let's see how it goes (edit: it goes fine :))

@marienfressinaud
Copy link
Copy Markdown
Member Author

For some reason, when PHPMailer has a problem, it creates a file under p/i folder :/ I need to investigate that…

It uses PHPMailer under the hood and only supports PHP >= 5.5
@marienfressinaud marienfressinaud force-pushed the tec/provide-minz-mailer branch from d43665b to e39671a Compare August 7, 2019 08:42
@marienfressinaud
Copy link
Copy Markdown
Member Author

Fixed, it's just that I don't know how to concatenate two strings in PHP :D (I used a , instead of a . when calling the Minz_Log::error method).

@Frenzie
Copy link
Copy Markdown
Member

Frenzie commented Aug 7, 2019

It's probably because with echo() you can just pass multiple strings separated by commas, and concatenating them first would be less efficient. (Although presumably seldom in a way that'd be remotely noticeable.)

@jkinable
Copy link
Copy Markdown
Contributor

@marienfressinaud what's the status of this PR? Is it ready to be merged into dev?

@Frenzie Frenzie added this to the 1.15.0 milestone Aug 14, 2019
@jkinable jkinable mentioned this pull request Aug 14, 2019
10 tasks
@Alkarex Alkarex merged commit de26531 into FreshRSS:dev Aug 15, 2019
@marienfressinaud marienfressinaud deleted the tec/provide-minz-mailer branch August 16, 2019 06:21
@Alkarex Alkarex mentioned this pull request Oct 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants