Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
Mime messages#30416
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
Mime messages#30416
Uh oh!
There was an error while loading.Please reload this page.
Conversation
36a06d0 toc9c55dcComparesrc/Symfony/Component/Mime/CharacterReader/Utf8CharacterReader.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
| // % and / are CPU intensive, so, maybe find a better way | ||
| $ignored =$strlen %$this->width; | ||
| $ignoredChars =$ignored ?substr($string, -$ignored) :''; | ||
| $currentMap =$this->width; |
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.
seems you have a type error here,currentMap must be anarray but it is assigned with anint
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.
removed the type hint for now, the code is quite messy, so it will need more thinking
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
OskarStark left a comment
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.
Thank you for this great new component ❤️
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Mime/CharacterReader/GenericFixedWidthCharacterReader.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Mime/CharacterReader/GenericFixedWidthCharacterReader.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Mime/CharacterReader/GenericFixedWidthCharacterReader.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
sstok left a comment
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.
Some minor suggestions, so far.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Taluu left a comment
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.
Had a quick look but overall 👍
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
a5f485a to96878a7Compare
nicolas-grekas left a comment
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.
That's a lot of work!
Character readers embed lots of logic. Do we want to be a bit more strict and just reject invalid UTF-8? An alternative could be to consider invalid UTF-8 as CP1252 and set a flag telling this was declared as UTF-8 but didn't really match. But that's for later I suppose :)
Uh oh!
There was an error while loading.Please reload this page.
| $this->twig =$twig; | ||
| $this->context =$context; | ||
| if (class_exists(HtmlConverter::class)) { | ||
| $this->converter =newHtmlConverter([ |
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.
How could we provide autodiscovery for this?
A "suggest" entry in composer.json maybe, but that's barely visible.
I don't have a better idea. (making it a requirement with runtime suggestion for the package?)
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.
That seems like a good place to start - throw an exception when/if it's used (inconvertHtmlToText()). So, if you set the text & html body, you'll never need it and never get an exception about missing it. But if you do, we say:
Cannot automatically convert HTML body to a text body. Run "composer require league/html-to-markdown"
or set the text content explicitly.
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 your suggestion@weaverryan, can you create a PR for it?
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
| * | ||
| * @experimental in 4.3 | ||
| */ | ||
| finalclass Renderer |
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.
Where is the class used? Or where do we plan to use it?
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 thought you were at my keynote, listening carefully :) Everything is explained in the presentation linked in the description of the PR.
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.
my core point is related to the design of the class :)
if it's final and has no interface, then type-hinting for it means creating strong coupling, while it could be usefull to provide an alternative implementation (eg another html-to-txt - I used to usew3m for that job and it does it nicely)
c741006 toed0858cCompare
nicolas-grekas left a comment
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 expect the deps=low failures to disappear after merge)
This PR was merged into the 4.3-dev branch.Discussion----------Mime messages| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | many on Swiftmailer| License | MIT| Doc PR | upcomingAs announced today at SymfonyLive Lille, here is the new MIME component.This PR is one step towards the new Symfony Mailer (announced at Symfony London). It started as a fork of Swiftmailer, but soon enough I rewrote almost everything to make it (hopefully) better and more flexible. I've removed all the complexity of Swiftmailer when it comes to multiparts for instance.Some big differences with Swiftmailer:* Way less complexity (no crazy dependency injection when not needed, less interfaces, no cache)* Plain data object and no state (out are the observers for charset and encoding, in are POPO and serializable objects)* No magic regarding multipart management, but a nice wrapper for the most common use casesswiftmailer/swiftmailer#434swiftmailer/swiftmailer#775swiftmailer/swiftmailer#946swiftmailer/swiftmailer#615swiftmailer/swiftmailer#184swiftmailer/swiftmailer#56 and probably many others* More Symfony-like* Messages are built on-demand and we do not mess up with your headers/body (Swiftmailer add headers and change yours, but here, we generate needed headers when converting the message as a string, they are not stored -- it means for instance that generating an Email twice will give you 2 different Date headers)* and probably more that I don't remember right nowI've also kept some nice features from Swiftmailer like support for any charset.More information on the slides:https://speakerdeck.com/fabpot/2-new-symfony-components-httpclient-and-mimeCommits-------ee787d1 [Mime] added classes for generating MIME messages
As announced today at SymfonyLive Lille, here is the new MIME component.
This PR is one step towards the new Symfony Mailer (announced at Symfony London). It started as a fork of Swiftmailer, but soon enough I rewrote almost everything to make it (hopefully) better and more flexible. I've removed all the complexity of Swiftmailer when it comes to multiparts for instance.
Some big differences with Swiftmailer:
Multipart hierarchy is god damn wrong. swiftmailer/swiftmailer#434
Multipart message is build up incorrectly swiftmailer/swiftmailer#775
AddPart and alternative body swiftmailer/swiftmailer#946
Content-Type: multipart/related not set when needed swiftmailer/swiftmailer#615
Swift_Image produces MIME-type multipart/related instead of multipart/alternative swiftmailer/swiftmailer#184
setBody() + addPart() with embedded images doesn't correctly add multipart/alternative entity swiftmailer/swiftmailer#56
and probably many others
I've also kept some nice features from Swiftmailer like support for any charset.
More information on the slides:
https://speakerdeck.com/fabpot/2-new-symfony-components-httpclient-and-mime