-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Mime] Simplify adding Parts to an Email #47462
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
Conversation
Hey! I think @alamirault has recently worked with this code. Maybe they can help review this? Cheers! Carsonbot |
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.
I think, deprecate methods in favor of one unique method is a good thing
54fa06b
to
07a54d2
Compare
07a54d2
to
83476e3
Compare
8a4b63b
to
0811e87
Compare
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.
I like it :)
Just some minor things.
0811e87
to
4843df3
Compare
4843df3
to
0a29d97
Compare
…l::addPart() (fabpot) This PR was merged into the 6.2 branch. Discussion ---------- [Mime] deprecate attach/embed methods in favor of Email::addPart() | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | n/a <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT | Doc PR | - #47462 follow-up Commits ------- 7cdbd20 [Mime] deprecate attach/embed methods in favor of Email::addPart()
…hiddewie) This PR was squashed before being merged into the 6.2 branch. Discussion ---------- Use `addPart` instead of `embed*` or `attach*`. Fixes symfony#17303 Ref symfony#17353 Ref symfony/symfony#47711 Ref symfony/symfony#47462 This PR contains the documentation for simplifications for adding parts to `Email`s. Commits ------- ebbffc5 Use `addPart` instead of `embed*` or `attach*`.
This PR was squashed before being merged into the 6.3 branch. Discussion ---------- [Mime] Fix email (de)serialization issues | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #47991 | License | MIT | Doc PR | - #48156 fixed #47991 while introducing a big breaking change (the `File` lazy load feature is broken and that was the whole point of that class when it was introduced in #47462 as that feature existed even prior to that PR) on a minor Symfony version (updating from 6.1 to 6.2 broke our application). More context can be found here: #48156 (comment) This PR aims to revert back the `attachFromPath` behavior to what it was before #48156 while still fixing the deserialization issue reported in #47991 The first commit fixes the serialization logic to work the same way it had worked on both 5.4 and 6.1 (which means we are reverting #48156), while the second commit fixes the deserialization issue reported in #47991. I've also added tests to prevent serialization/deserialization regressions in the future. Commits ------- 32836b9 [Mime] Fix email (de)serialization issues
While fixing some MIME bugs, I realized we have a substantial cyclomatic complexity due to the attach/attachFromPath/embed/embedFromPath/attachPart methods on the Email class.
This PR simplifies all of that and introduces a way to have a file for TextPart as well (via the new
file://
notation) and it keeps the lazy-loading feature which was why those methods were introduced in the first place.From now, I've kept all the methods, but I'm wondering if we should deprecate all of them and only keep
attachPart()
(which I would like to renameaddPart()
).