Skip to content

Commit 1f87ae1

Browse files
authored
refactor #164 Remove support for Swiftmailer (Zales0123)
This PR was merged into the 1.7-dev branch. Discussion ---------- | Q | A | --------------- | ----- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Related tickets | | License | MIT Let\'s finally get rid of it 🚀 🔥 2.0.0 will support only Symfony Mailer (together with Symfony 6) as mentioned [here](#145 (comment)) 🖖 Commits ------- d2342f1 Remove support for Swiftmailer
2 parents 6e748d8 + d2342f1 commit 1f87ae1

File tree

20 files changed

+6
-449
lines changed

20 files changed

+6
-449
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,6 @@ jobs:
5050
run: |
5151
composer require "twig/twig:${{ matrix.twig }}" --no-update --no-scripts
5252
53-
-
54-
name: Remove Swiftmailer on Symfony >= 6
55-
if: matrix.symfony != '5.4.*'
56-
run: |
57-
composer remove --dev symfony/swiftmailer-bundle --no-update --no-scripts
58-
rm src/Bundle/spec/Sender/Adapter/SwiftMailerAdapterSpec.php
59-
6053
-
6154
name: Install dependencies
6255
run: |
@@ -87,36 +80,15 @@ jobs:
8780

8881
-
8982
name: Test bundle (with all services)
90-
if: matrix.symfony == '5.4.*'
9183
run: |
9284
rm -rf src/Bundle/test/var/cache
93-
composer require symfony/mailer --no-interaction --no-scripts
94-
composer require symfony/swiftmailer-bundle --no-interaction --no-scripts
95-
(cd src/Bundle/test && APP_ENV=test bin/console lint:container)
96-
97-
-
98-
name: Test bundle (with Swift Mailer)
99-
if: matrix.symfony == '5.4.*'
100-
run: |
101-
rm -rf src/Bundle/test/var/cache
102-
composer remove symfony/mailer --no-scripts
103-
composer require symfony/swiftmailer-bundle --no-interaction --no-scripts
104-
(cd src/Bundle/test && APP_ENV=test_with_swiftmailer bin/console lint:container)
105-
vendor/bin/phpunit src/Bundle/tests/Functional/SwiftmailerSenderTest.php
106-
107-
-
108-
name: Test bundle (with SymfonyMailer)
109-
run: |
110-
rm -rf src/Bundle/test/var/cache
111-
composer remove symfony/swiftmailer-bundle --no-scripts
11285
composer require symfony/mailer --no-scripts
113-
(cd src/Bundle/test && APP_ENV=test_with_symfony_mailer bin/console lint:container)
114-
vendor/bin/phpunit src/Bundle/tests/Functional/SymfonyMailerSenderTest.php
86+
(cd src/Bundle/test && APP_ENV=test bin/console lint:container)
87+
vendor/bin/phpunit
11588
11689
-
11790
name: Run lint container (with no mailers)
11891
run: |
11992
rm -rf src/Bundle/test/var/cache
12093
composer remove symfony/mailer --no-scripts
121-
composer remove symfony/swiftmailer-bundle --no-scripts
12294
(cd src/Bundle/test && APP_ENV=test_no_mailers bin/console lint:container)

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"keywords": [
66
"mailer",
77
"email",
8-
"swiftmailer"
8+
"symfony"
99
],
1010
"homepage": "https://sylius.com",
1111
"license": "MIT",
@@ -46,7 +46,6 @@
4646
"phpunit/phpunit": "^9.4",
4747
"rector/rector": "^0.13.6",
4848
"sylius-labs/coding-standard": "^4.0",
49-
"symfony/swiftmailer-bundle": "^3.1",
5049
"symfony/console": "^5.4 || ^6.0",
5150
"symfony/dotenv": "^5.4 || ^6.0",
5251
"symfony/event-dispatcher": "^5.4 || ^6.0",

docs/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
```yaml
44
sylius_mailer:
5-
sender_adapter: sylius.email_sender.adapter.swiftmailer # Adapter for sending e-mails.
5+
sender_adapter: sylius.email_sender.adapter.symfony_mailer # Adapter for sending e-mails.
66
renderer_adapter: sylius.email_renderer.adapter.twig # Adapter for rendering e-mails.
77
sender:
88
name: # Required - default sender name.

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Sending customizable e-mails has never been easier in Symfony.
55
You can configure different e-mail types in the YAML or in database. (and use YAML as fallback)
66
This allows you to send out e-mails with one simple method call, providing an unique code and data.
77

8-
The bundle supports adapters, by default e-mails are rendered using Twig and sent via Swiftmailer, but you can easily implement your own adapter and delegate the whole operation to external API.
8+
The bundle supports adapters, by default e-mails are rendered using Twig and sent via Symfony Mailer, but you can easily implement your own adapter and delegate the whole operation to external API.
99

1010
This bundle provides easy integration of the [Sylius mailer component](https://docs.sylius.com/en/latest/components_and_bundles/components/Mailer/index.html)
1111
with any Symfony full-stack application.

phpstan.neon

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ parameters:
1010
excludePaths:
1111
- %currentWorkingDirectory%/src/Bundle/DependencyInjection/Configuration.php
1212
- %currentWorkingDirectory%/src/Bundle/DependencyInjection/SyliusMailerExtension.php
13-
- %currentWorkingDirectory%/src/Bundle/Sender/Adapter/SwiftMailerAdapter.php
1413
- %currentWorkingDirectory%/src/Bundle/spec/*
1514
- %currentWorkingDirectory%/src/Bundle/test/*
1615
- %currentWorkingDirectory%/src/Bundle/tests/*

psalm.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
<directory name="src/Bundle/test" />
1313
<directory name="src/Bundle/tests" />
1414
<file name="src/Bundle/DependencyInjection/SyliusMailerExtension.php" />
15-
<file name="src/Bundle/Sender/Adapter/SwiftMailerAdapter.php" />
1615
<directory name="src/Component/spec" />
1716
<directory name="src/Component/vendor" />
1817
</ignoreFiles>

src/Bundle/DependencyInjection/SyliusMailerExtension.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ protected function loadInternal(array $mergedConfig, ContainerBuilder $container
4444

4545
private function configureSenderAdapter(array $mergedConfig, ContainerBuilder $container): void
4646
{
47-
if (!ContainerBuilder::willBeAvailable('swiftmailer/swiftmailer', \Swift::class, ['symfony/swiftmailer-bundle'])) {
48-
$container->removeDefinition('sylius.email_sender.adapter.swiftmailer');
49-
}
50-
5147
if (!ContainerBuilder::willBeAvailable('symfony/mailer', MailerInterface::class, ['symfony/framework-bundle'])) {
5248
$container->removeDefinition('sylius.email_sender.adapter.symfony_mailer');
5349
}
@@ -59,7 +55,6 @@ private function configureSenderAdapter(array $mergedConfig, ContainerBuilder $c
5955
}
6056

6157
$services = [
62-
'sylius.email_sender.adapter.swiftmailer',
6358
'sylius.email_sender.adapter.symfony_mailer',
6459
'sylius.email_sender.adapter.default',
6560
];

src/Bundle/Resources/config/services.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,6 @@
7070
parent="sylius.email_sender.adapter.abstract"
7171
public="true"
7272
/>
73-
<service
74-
id="sylius.email_sender.adapter.swiftmailer"
75-
class="Sylius\Bundle\MailerBundle\Sender\Adapter\SwiftMailerAdapter"
76-
parent="sylius.email_sender.adapter.abstract"
77-
public="true"
78-
>
79-
<deprecated package="sylius/mailer-bundle" version="1.8">The "%service_id%" service is deprecated and will be removed in 2.0, use the Symfony Mailer integration instead.</deprecated>
80-
<argument type="service" id="swiftmailer.mailer.default" />
81-
<argument type="service" id="event_dispatcher" on-invalid="null" />
82-
</service>
8373
<service
8474
id="sylius.email_sender.adapter.symfony_mailer"
8575
class="Sylius\Bundle\MailerBundle\Sender\Adapter\SymfonyMailerAdapter"

src/Bundle/Sender/Adapter/SwiftMailerAdapter.php

Lines changed: 0 additions & 144 deletions
This file was deleted.

0 commit comments

Comments
 (0)