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] Add support for allowing some users even ifrecipients is defined inEnvelopeListener#54044

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:7.1fromlyrixx:mailer-EnvelopeListener
Apr 9, 2024

Conversation

@lyrixx
Copy link
Member

@lyrixxlyrixx commentedFeb 23, 2024
edited
Loading

QA
Branch?7.1
Bug fix?no
New feature?yes
Deprecations?no
Issues-
LicenseMIT

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


depends on#54292

@lyrixxlyrixxforce-pushed themailer-EnvelopeListener branch from876707a to83cc068CompareFebruary 23, 2024 16:54
@lyrixxlyrixxforce-pushed themailer-EnvelopeListener branch from83cc068 to82ab4e4CompareFebruary 28, 2024 07:40
@nicolas-grekas
Copy link
Member

I don't understand what's this for, can you please give me a few examples ? The code is fairly intricated for only two options and I'm wondering how this logic is sensible for real world use cases. 🙏

@lyrixx
Copy link
MemberAuthor

Sure,here is the documentation

And our real world example is for the preproduction:

mailer_recipients:[ 'REDACTED@jolicode.com' ]mailer_recipients_allowed:[ '/@jolicode\.com$/', '/^foobar@example\.com$/', '/^baz@example\.com$/' ]

TL;DR:

in preprod, we want that all mails to be sent to'REDACTED@jolicode.com' except the ones targeting our agency, or some specials client mail addresses

@lyrixx
Copy link
MemberAuthor

I added some tests for the DIC part. But the configuration was broken in XML. I need#54292 first to be merged

lyrixx added a commit that referenced this pull requestMar 15, 2024
This PR was merged into the 5.4 branch.Discussion----------[FrameworkBundle] Fix mailer config with XML| Q             | A| ------------- | ---| Branch?       | 5.4| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Issues        || License       | MITI 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 didiff --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.xmlindexbe53f59..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\XmlFrameworkExtensionTestE                                                                   1 / 1 (100%)RTime: 00:00.103, Memory: 21.88 MBThere 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 patchCommits-------0cfdf2f [FrameworkBundle] Fix mailer config with XML
@lyrixxlyrixxforce-pushed themailer-EnvelopeListener branch fromef69bed to7661e81CompareMarch 15, 2024 14:50
@lyrixx
Copy link
MemberAuthor

I have rebased, now the PR is to merge

@lyrixxlyrixxforce-pushed themailer-EnvelopeListener branch 2 times, most recently from22d2b54 to331438dCompareMarch 21, 2024 08:04
@lyrixxlyrixxforce-pushed themailer-EnvelopeListener branch from331438d to694863fCompareMarch 21, 2024 08:13
@lyrixxlyrixxforce-pushed themailer-EnvelopeListener branch from694863f to9139712CompareMarch 21, 2024 08:18
@lyrixxlyrixxforce-pushed themailer-EnvelopeListener branch from9139712 to41d542bCompareMarch 21, 2024 09:11
@lyrixx
Copy link
MemberAuthor

@nicolas-grekas I have addressed your comments

Copy link
Member

@fabpotfabpot left a comment

Choose a reason for hiding this comment

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

@lyrixx We should probably add an entry in the framework bundle changelog as well like:

 * Add the `allowed_recipients` option for mailer to allow some users to receive emails even if `recipients` is defined.

@lyrixxlyrixxforce-pushed themailer-EnvelopeListener branch from41d542b to6228896CompareApril 8, 2024 13:46
@lyrixx
Copy link
MemberAuthor

@fabpot thanks. Added (+ rebased)

@fabpot
Copy link
Member

Thank you@lyrixx.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@OskarStarkOskarStarkOskarStark left review comments

@fabpotfabpotfabpot approved these changes

@stofstofstof approved these changes

@welcoMatticwelcoMatticwelcoMattic approved these changes

+1 more reviewer

@stloydstloydstloyd left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

7.1

Development

Successfully merging this pull request may close these issues.

8 participants

@lyrixx@nicolas-grekas@fabpot@stloyd@stof@welcoMattic@OskarStark@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp