Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Mailer] Fix the possibility to set a From header from MessageListener#31774

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:4.3fromfabpot:from-header-from-listener-fix
Jun 4, 2019

Conversation

@fabpot
Copy link
Member

QA
Branch?4.3
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#31733
LicenseMIT
Doc PRn/a

$this->setRecipients($recipients);
}

publicstaticfunctioncreate(RawMessage$message):self
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Not sure if we should keep this method.

@weaverryan
Copy link
Member

weaverryan commentedMay 31, 2019
edited
Loading

@fabpot I'm getting a new error:

An email must have a "From" header

I think it relates to the difference between "Sender" and "From" that I was mentioning (#31733 (comment)) - though I'm far from an expert on this stuff. Should theEnvelopeListener set both senderand from? Or just the from, since the sender is derived from that?

@fabpot
Copy link
MemberAuthor

fabpot commentedMay 31, 2019
edited
Loading

"From" is what you write on the letter, "Sender" is what you write on the envelope. If you don't provide an envelope, we create one for you based on what you wrote on the letter. So, you must always provide a "From" (or register a MessageListener to do it for you -- will be part of the semantic configuration when available of course).

@nicolas-grekasnicolas-grekas added this to the4.3 milestoneJun 1, 2019
@fabpotfabpotforce-pushed thefrom-header-from-listener-fix branch from146f260 tof4254e6CompareJune 1, 2019 08:24

publicfunction__construct(RawMessage$message)
{
if (!$messageinstanceof Message) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Wouldn't it be better to change the type-hint instead? If we want to support any other message in the future we can still change the type then.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I don't think so. I've done it that way to get a "better" error message.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

But it means that the user will only get an error at runtime if they didn't discover before thatMessage instances are required here. With a proper type hint they can be warned before.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

How would they be warned before? I suppose you're thinking about static analysis. Not sure what to do.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

In any case, that's independent from this PR as I'm doing the same at several other places (and this code is copy/pasted from SmtpEnvelope).

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

xabbuh reacted with thumbs up emoji
@fabpotfabpot merged commitf4254e6 intosymfony:4.3Jun 4, 2019
fabpot added a commit that referenced this pull requestJun 4, 2019
…sageListener (fabpot)This PR was merged into the 4.3 branch.Discussion----------[Mailer] Fix the possibility to set a From header from MessageListener| Q             | A| ------------- | ---| Branch?       | 4.3| Bug fix?      | yes| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->| BC breaks?    | no     <!-- seehttps://symfony.com/bc -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->| Fixed tickets |#31733| License       | MIT| Doc PR        | n/a<!--Replace this notice by a short README for your feature/bugfix. This will help peopleunderstand your PR and can be used as a start for the documentation.Additionally (seehttps://symfony.com/roadmap): - Bug fixes must be submitted against the lowest maintained branch where they apply   (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against branch 4.4. - Legacy code removals go to the master branch.-->Commits-------f4254e6 [Mailer] fixed the possibility to set a From header from MessageListener
@fabpotfabpot mentioned this pull requestJun 4, 2019
fabpot added a commit that referenced this pull requestJun 4, 2019
This PR was merged into the 4.3 branch.Discussion----------Change type hints| Q             | A| ------------- | ---| Branch?       | 4.3 for features / 3.4, 4.2 or 4.3 for bug fixes <!-- see below -->| Bug fix?      | yes| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->| BC breaks?    | no     <!-- seehttps://symfony.com/bc -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->| Fixed tickets | n/a| License       | MIT| Doc PR        | n/asee#31774 (comment)<!--Replace this notice by a short README for your feature/bugfix. This will help peopleunderstand your PR and can be used as a start for the documentation.Additionally (seehttps://symfony.com/roadmap): - Bug fixes must be submitted against the lowest maintained branch where they apply   (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against branch 4.4. - Legacy code removals go to the master branch.-->Commits-------d56ae06 changed type hints
@fabpotfabpot mentioned this pull requestJun 6, 2019
@fabpotfabpot deleted the from-header-from-listener-fix branchJuly 18, 2019 20:17
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@derrabusderrabusderrabus left review comments

@xabbuhxabbuhxabbuh left review comments

Assignees

No one assigned

Projects

None yet

Milestone

4.3

Development

Successfully merging this pull request may close these issues.

6 participants

@fabpot@weaverryan@derrabus@xabbuh@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp