From c58bc0a7ffb94d969119da21f62534e202185f51 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Tue, 1 Aug 2023 10:06:47 +1200 Subject: [PATCH] FIX Use TransportFactory to prevent infinite config loop --- _config/mailer.yml | 13 +------------ src/Control/Email/TransportFactory.php | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 12 deletions(-) create mode 100644 src/Control/Email/TransportFactory.php diff --git a/_config/mailer.yml b/_config/mailer.yml index 5419272516b..d930bac90fd 100644 --- a/_config/mailer.yml +++ b/_config/mailer.yml @@ -11,18 +11,7 @@ SilverStripe\Core\Injector\Injector: calls: - [addSubscriber, ['%$SilverStripe\Control\Email\MailerSubscriber']] Symfony\Component\Mailer\Transport\TransportInterface: - factory: Symfony\Component\Mailer\Transport - factory_method: fromDsn + factory: SilverStripe\Control\Email\TransportFactory constructor: dsn: 'sendmail://default' dispatcher: '%$Symfony\Component\EventDispatcher\EventDispatcherInterface.mailer' ---- -Name: mailer-dsn-env -After: '*' -Only: - envvarset: MAILER_DSN ---- -SilverStripe\Core\Injector\Injector: - Symfony\Component\Mailer\Transport\TransportInterface: - constructor: - dsn: '`MAILER_DSN`' diff --git a/src/Control/Email/TransportFactory.php b/src/Control/Email/TransportFactory.php new file mode 100644 index 00000000000..c8c656c80bc --- /dev/null +++ b/src/Control/Email/TransportFactory.php @@ -0,0 +1,21 @@ +