Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Mailer] Addrecipient_fetcher option that allows fetching global recipients from a service#62165
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
base:7.4
Are you sure you want to change the base?
Conversation
carsonbot commentedOct 26, 2025
Hey! I see that this is your first PR. That is great! Welcome! Symfony has acontribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
ef04c78 to7213ed3CompareFor the failing checks, I do not understand why the |
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.
For the failing checks, I do not understand why the
RecipientFetcherInterfaceinterface cannot be found while the problem does not occur in the other ones.
The failing jobs run the tests after installing the dependencies ofsrc/Symfmony/Bundle/FrameworkBundle/composer.json with lowest and highest versions constraint. Currently the new classes doesn't exist insymfony/mailer in any version (v6.4.0 and8.0.x-dev 46faf03 are tested).
src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.phpShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTestCase.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
…ecipients from a service
7213ed3 toac6a3c9Compare
Thank you@GromNaN for giving me the explanation and the hints I needed to make the checks pass. |
Uh oh!
There was an error while loading.Please reload this page.
Until now, the
Mailercomponent provided two ways to configure recipients globally:mailer.envelope.recipientsoption for static ones,MessageEventevent for dynamic ones.As a new developer joining an existing Symfony project and assigned to work with the
Mailercomponent, your first action would be to look at theconfig/packages/mailer.yamlfile.However, if the recipients were configured through an
EventListener, you would need more time to be aware of its existence.Today, in order to improve the developer experience, I propose to add a
mailer.envelope.recipient_fetcheroption that allows fetching global recipients from a service, and therefore from external sources (database, LDAP, etc.).Example
config/packages/mailer.yamlsrc/Mailer/AdminRecipientFetcher.phpAcknowledgements
api-platform/coreandlexik/LexikJWTAuthenticationBundlewhich taught me how to check in the configuration if a class implements an interface,