Skip to content

Commit

Permalink
NEW Migrate from swiftmailer/swiftmailer to symfony/mailer
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Oct 7, 2022
1 parent 83a09da commit 8da141a
Show file tree
Hide file tree
Showing 21 changed files with 908 additions and 1,923 deletions.
61 changes: 52 additions & 9 deletions _config/email.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,55 @@
---
Name: emailconfig
Name: mailer
---
SilverStripe\Core\Injector\Injector:
Swift_Transport: Swift_MailTransport
Swift_Mailer:
constructor:
- '%$Swift_Transport'
SilverStripe\Control\Email\Mailer:
class: SilverStripe\Control\Email\SwiftMailer
properties:
SwiftMailer: '%$Swift_Mailer'
Symfony\Component\Mailer\MailerInterface:
class: Symfony\Component\Mailer\Mailer
constructor:
0: '%$Symfony\Component\Mailer\Transport\TransportInterface'
1: '%$Symfony\Component\Messenger\MessageBusInterface.mailer'
Symfony\Component\Messenger\MessageBusInterface.mailer:
class: Symfony\Component\Messenger\MessageBus
constructor:
0:
- '%$Symfony\Component\Messenger\Middleware\MiddlewareInterface.mailer'
Symfony\Component\Messenger\Middleware\MiddlewareInterface.mailer:
class: Symfony\Component\Messenger\Middleware\SendMessageMiddleware
constructor:
0: '%$Symfony\Component\Messenger\Transport\Sender\SendersLocatorInterface.mailer'
1: '%$Symfony\Component\EventDispatcher\EventDispatcherInterface.mailer'
Symfony\Component\Messenger\Transport\Sender\SendersLocatorInterface.mailer:
class: Symfony\Component\Messenger\Transport\Sender\SendersLocator
constructor:
0:
'*':
- 'Symfony\Component\Messenger\Transport\Sender\SenderInterface.mailer'
1: '%$Symfony\Component\DependencyInjection\ContainerInterface.mailer'
Symfony\Component\Messenger\Transport\Sender\SenderInterface.mailer:
class: SilverStripe\Control\Email\EmailSender
Symfony\Component\DependencyInjection\ContainerInterface.mailer:
class: Symfony\Component\DependencyInjection\Container
calls:
- ['set', ['Symfony\Component\Messenger\Transport\Sender\SenderInterface.mailer', '%$Symfony\Component\Messenger\Transport\Sender\SenderInterface.mailer']]
Symfony\Component\EventDispatcher\EventDispatcherInterface.mailer:
class: Symfony\Component\EventDispatcher\EventDispatcher
---
Name: mailer-dsn-default-config
---
SilverStripe\Core\Injector\Injector:
Symfony\Component\Mailer\Transport\TransportInterface:
factory: Symfony\Component\Mailer\Transport
factory_method: fromDsn
constructor:
dsn: 'sendmail://default'
---
Name: mailer-dsn-env
After:
- 'mailer-dsn-default-config'
- 'mailer-dsn-project-config'
Only:
envvarset: MAILER_DSN
---
SilverStripe\Core\Injector\Injector:
Symfony\Component\Mailer\Transport\TransportInterface:
constructor:
dsn: '`MAILER_DSN`'
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,13 @@
"silverstripe/assets": "^2",
"silverstripe/vendor-plugin": "^2",
"sminnee/callbacklist": "^0.1.1",
"swiftmailer/swiftmailer": "^6.3.0",
"symfony/cache": "^6.1",
"symfony/config": "^6.1",
"symfony/dependency-injection": "^6.1",
"symfony/filesystem": "^6.1",
"symfony/mailer": "^6.1",
"symfony/messenger": "^6.1",
"symfony/mime": "^6.1",
"symfony/translation": "^6.1",
"symfony/yaml": "^6.1",
"ext-ctype": "*",
Expand Down Expand Up @@ -96,9 +99,6 @@
},
"files": [
"src/includes/constants.php"
],
"classmap": [
"thirdparty/swiftmailer"
]
},
"include-path": [
Expand Down
Loading

0 comments on commit 8da141a

Please sign in to comment.