Skip to content

Commit c455af3

Browse files
committed
[Mailer] add Mailtrap bridge
1 parent 1743ff8 commit c455af3

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

Exception/UnsupportedSchemeException.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ class UnsupportedSchemeException extends LogicException
6868
'class' => Bridge\Postmark\Transport\PostmarkTransportFactory::class,
6969
'package' => 'symfony/postmark-mailer',
7070
],
71+
'mailtrap' => [
72+
'class' => Bridge\Mailtrap\Transport\MailtrapTransportFactory::class,
73+
'package' => 'symfony/mailtrap-mailer',
74+
],
7175
'resend' => [
7276
'class' => Bridge\Resend\Transport\ResendTransportFactory::class,
7377
'package' => 'symfony/resend-mailer',

Tests/Exception/UnsupportedSchemeExceptionTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use Symfony\Component\Mailer\Bridge\Mailjet\Transport\MailjetTransportFactory;
2525
use Symfony\Component\Mailer\Bridge\Mailomat\Transport\MailomatTransportFactory;
2626
use Symfony\Component\Mailer\Bridge\MailPace\Transport\MailPaceTransportFactory;
27+
use Symfony\Component\Mailer\Bridge\Mailtrap\Transport\MailtrapTransportFactory;
2728
use Symfony\Component\Mailer\Bridge\Postal\Transport\PostalTransportFactory;
2829
use Symfony\Component\Mailer\Bridge\Postmark\Transport\PostmarkTransportFactory;
2930
use Symfony\Component\Mailer\Bridge\Resend\Transport\ResendTransportFactory;
@@ -54,6 +55,7 @@ public static function setUpBeforeClass(): void
5455
MandrillTransportFactory::class => false,
5556
PostalTransportFactory::class => false,
5657
PostmarkTransportFactory::class => false,
58+
MailtrapTransportFactory::class => false,
5759
ResendTransportFactory::class => false,
5860
ScalewayTransportFactory::class => false,
5961
SendgridTransportFactory::class => false,
@@ -89,6 +91,7 @@ public static function messageWhereSchemeIsPartOfSchemeToPackageMapProvider(): \
8991
yield ['mandrill', 'symfony/mailchimp-mailer'];
9092
yield ['postal', 'symfony/postal-mailer'];
9193
yield ['postmark', 'symfony/postmark-mailer'];
94+
yield ['mailtrap', 'symfony/mailtrap-mailer'];
9295
yield ['resend', 'symfony/resend-mailer'];
9396
yield ['scaleway', 'symfony/scaleway-mailer'];
9497
yield ['sendgrid', 'symfony/sendgrid-mailer'];

Transport.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use Symfony\Component\Mailer\Bridge\Mailjet\Transport\MailjetTransportFactory;
2525
use Symfony\Component\Mailer\Bridge\Mailomat\Transport\MailomatTransportFactory;
2626
use Symfony\Component\Mailer\Bridge\MailPace\Transport\MailPaceTransportFactory;
27+
use Symfony\Component\Mailer\Bridge\Mailtrap\Transport\MailtrapTransportFactory;
2728
use Symfony\Component\Mailer\Bridge\Postal\Transport\PostalTransportFactory;
2829
use Symfony\Component\Mailer\Bridge\Postmark\Transport\PostmarkTransportFactory;
2930
use Symfony\Component\Mailer\Bridge\Resend\Transport\ResendTransportFactory;
@@ -63,6 +64,7 @@ final class Transport
6364
MandrillTransportFactory::class,
6465
PostalTransportFactory::class,
6566
PostmarkTransportFactory::class,
67+
MailtrapTransportFactory::class,
6668
ResendTransportFactory::class,
6769
ScalewayTransportFactory::class,
6870
SendgridTransportFactory::class,

0 commit comments

Comments
 (0)