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

[FrameworkBundle] Fix mailer config with XML #54292

Merged
merged 1 commit into from Mar 15, 2024

Conversation

lyrixx
Copy link
Member

@lyrixx lyrixx commented Mar 14, 2024

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Issues
License MIT

I noticed that, while adding test for #54044


Before my patch, if I keep only one recipients:

>…ome/gregoire/dev/github.com/lyrixx/symfony(5.4 *) git di
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/mailer_with_dsn.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/mailer_with_dsn.xml
index be53f59bc3..5ccdefaf32 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/mailer_with_dsn.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/mailer_with_dsn.xml
@@ -11,7 +11,7 @@
             <framework:envelope>
                 <framework:sender>sender@example.org</framework:sender>
                 <framework:recipients>redirected@example.org</framework:recipients>
-                <framework:recipients>redirected1@example.org</framework:recipients>
+                <!-- <framework:recipients>redirected1@example.org</framework:recipients> -->
             </framework:envelope>
             <framework:header name="from">from@example.org</framework:header>
             <framework:header name="bcc">bcc1@example.org</framework:header>
>…ome/gregoire/dev/github.com/lyrixx/symfony(5.4 *) ./phpunit src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/XmlFrameworkExtensionTest.php --filter 'testMailer#0'
PHPUnit 9.6.16 by Sebastian Bergmann and contributors.

Warning:       Your XML configuration validates against a deprecated schema.
Suggestion:    Migrate your XML configuration using "--migrate-configuration"!

Testing Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\XmlFrameworkExtensionTest
E                                                                   1 / 1 (100%)R

Time: 00:00.103, Memory: 21.88 MB

There was 1 error:

1) Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\XmlFrameworkExtensionTest::testMailer with data set #0 ('mailer_with_dsn', array('smtp://example.com'))
Symfony\Component\Config\Definition\Exception\InvalidTypeException: Invalid type for path "framework.mailer.envelope.recipients". Expected "array", but got "string"

And I cannot add more XML configuration, without this patch

@lyrixx
Copy link
Member Author

lyrixx commented Mar 15, 2024

Failures seems un-related

@lyrixx lyrixx merged commit cb3ec06 into symfony:5.4 Mar 15, 2024
7 of 12 checks passed
@lyrixx lyrixx deleted the mailer-recipiends branch March 15, 2024 14:45
This was referenced Apr 2, 2024
fabpot added a commit that referenced this pull request Apr 9, 2024
…recipients` is defined in `EnvelopeListener` (lyrixx)

This PR was merged into the 7.1 branch.

Discussion
----------

[Mailer] Add support for allowing some users even if `recipients` is defined in `EnvelopeListener`

| Q             | A
| ------------- | ---
| Branch?       | 7.1
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Issues        | -
| License       | MIT

I'm migrate an application from SwiftMailer to symfony/mailer, and this options was used.

---

depends on #54292

Commits
-------

6228896 [Mailer] Add support for allowing some users even if `recipients` is defined in `EnvelopeListener`
@renovate renovate bot mentioned this pull request Apr 28, 2024
1 task
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.

None yet

4 participants