Skip to content
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

[Mime] Support custom encoders in mime parts #54975

Merged
merged 1 commit into from
May 31, 2024

Conversation

KDederichs
Copy link
Contributor

Q A
Branch? 7.1
Bug fix? no
New feature? yes
Deprecations? no
Issues Fix #54973
License MIT

Allow adding custom encoders to Text Parts

@carsonbot carsonbot added this to the 7.1 milestone May 17, 2024
@derrabus derrabus added the Mime label May 17, 2024
@carsonbot carsonbot changed the title feat: support custom encoders in mime parts [Mime] feat: support custom encoders in mime parts May 17, 2024
@KDederichs
Copy link
Contributor Author

Dunno, those test failures look not related and kind of random?

@KDederichs
Copy link
Contributor Author

Also can this still be squeezed into 7.1 or do we have feature freeze since we got RC1 now? (I kind of really need this :D)

@derrabus
Copy link
Member

derrabus commented May 17, 2024

We have feature freeze for over two weeks already. I see no reason to make an exception here, sorry.

@derrabus derrabus modified the milestones: 7.1, 7.2 May 17, 2024
@KDederichs
Copy link
Contributor Author

Ah too bad, guess I'll copy stuff around till 7.2 then

@derrabus
Copy link
Member

Ah too bad, guess I'll copy stuff around till 7.2 then

Yeah, too bad that Composer cannot install dev snapshots. Oh wait.

src/Symfony/Component/Mime/Part/TextPart.php Outdated Show resolved Hide resolved
src/Symfony/Component/Mime/Tests/Part/TextPartTest.php Outdated Show resolved Hide resolved
src/Symfony/Component/Mime/Tests/Part/TextPartTest.php Outdated Show resolved Hide resolved
src/Symfony/Component/Mime/Part/TextPart.php Outdated Show resolved Hide resolved
src/Symfony/Component/Mime/Part/TextPart.php Outdated Show resolved Hide resolved
if ('quoted-printable' !== $encoding && 'base64' !== $encoding && '8bit' !== $encoding) {
throw new InvalidArgumentException(sprintf('The encoding must be one of "quoted-printable", "base64", or "8bit" ("%s" given).', $encoding));
if (!\in_array($encoding, self::DEFAULT_ENCODERS) && !\array_key_exists($encoding, self::$encoders)) {
throw new InvalidArgumentException('The encoding must be one of "quoted-printable", "base64", or "8bit". In case you are trying to use a custom encoder, please add it first.');
Copy link
Member

Choose a reason for hiding this comment

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

Shall we just list all available encodings? I don't think the second sentence is necessary then.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, sounds good.
I'll change it.

src/Symfony/Component/Mime/Part/TextPart.php Outdated Show resolved Hide resolved
src/Symfony/Component/Mime/Part/TextPart.php Outdated Show resolved Hide resolved
@derrabus derrabus changed the title [Mime] feat: support custom encoders in mime parts [Mime] Support custom encoders in mime parts May 21, 2024
@fabpot
Copy link
Member

fabpot commented May 31, 2024

Thank you @KDederichs.

@fabpot fabpot merged commit 838ff87 into symfony:7.2 May 31, 2024
5 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Mime] Allow custom encoders for parts
4 participants