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
Fix: Ensure e-mails would always have a sender address set #6519
Conversation
bc36d19
to
7e90f79
Compare
@martin-rueegg Hmm, not sure if I like this approach, replace the mailer access with a helper class. Maybe we could also use a different "TestMailer" in the Testing config. |
@luke- Thanks for looking into this. The Helper class already exists. And yes, we could move that function to the existing Mailer class instead. Might make more sense indeed. I've thought about it but then mistakenly concluded there would be a name conflict... The current production mailer has this code implemented. However, since it's a configurable component, should the sender not be assured in any case? Even if a admin chooses to use his own implementation of the mailer? In my personal view, it is the job of the mail client (in this case the code that is creating the mail) to make sure, the correct sender is set. As opposed to the mail service, to do this.. Likewise I'd make sure, the e-mail conforms to the minimum requirements, no matter what mailer class, service or server is used further down the road. This helper function (which I can happily move to the mailer class) is ensuring that. |
7e90f79
to
eb6a249
Compare
@martin-rueegg Hmm, ok got your point. Since we already modified and enhanced the Yii 2 mailer component, I don't think we should expect this to be configurable/replaceable with another custom class. If we want to support this, you're right, we need some Helper/Service which handles defaults and customizations from HumHub core. To keep it simple, I would treat this core component as non-modifiable. I would also like to stay as close as possible to the Yii 2 standard/documentation/style and somehow it looks wrong to me now to replace the familiar So currently I would prefer to:
What do you think? |
322299a
to
e953068
Compare
@luke- Ok, sounds fair enough. How about creating an additional interface Now, of course we could also add a I've made a suggestion in the current code. |
Additionally, I've
|
c6a93ca
to
a791189
Compare
@martin-rueegg Thanks, looks really nice now! Can you take a look into the tests? |
@luke- yes, I'm on it. You suggested to
I thought it would be nicer to have it under The current test failed because they could not load the From |
OK, so So in order to cheat here, we could set a definition in |
a791189
to
81971e7
Compare
I think I've nailed it. So it appears, that from the test server ( The Codeception
(Yes, dem Ingeniör ist nichts zu schwör! ;-) ) Now let's see what the test suite says ... |
Looking good! 👍 |
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.
@martin-rueegg Thanks, is 'v1.16' ok as PR target?
In theory, yes. However, we've already introduced the I can create an other PR with these changes that we merge into Could you please update |
@martin-rueegg Yes thanks, sounds good. I've just updated |
81971e7
to
98a3bd9
Compare
…t is fired in the web application too (humhub#6505)
98a3bd9
to
7b19fbe
Compare
Depending on the mailer used, the
From
-address of an e-mail would not be set (e.g. when using the test mailer from the testing framework).Using a helper function to compose the message ensures that the sender is always set.
What kind of change does this PR introduce?
Does this PR introduce a breaking change?
The PR fulfills these requirements:
develop
branch, not themaster
branch if no hotfixOther information: