Skip to content

Commit 0f836d7

Browse files
farhadhffabpot
authored andcommitted
[Mailer] Add AhaSend Bridge
1 parent a305f46 commit 0f836d7

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
@@ -20,6 +20,10 @@
2020
class UnsupportedSchemeException extends LogicException
2121
{
2222
private const SCHEME_TO_PACKAGE_MAP = [
23+
'ahasend' => [
24+
'class' => Bridge\AhaSend\Transport\AhaSendTransportFactory::class,
25+
'package' => 'symfony/ahasend-mailer',
26+
],
2327
'azure' => [
2428
'class' => Bridge\Azure\Transport\AzureTransportFactory::class,
2529
'package' => 'symfony/azure-mailer',

Tests/Exception/UnsupportedSchemeExceptionTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Bridge\PhpUnit\ClassExistsMock;
16+
use Symfony\Component\Mailer\Bridge\AhaSend\Transport\AhaSendTransportFactory;
1617
use Symfony\Component\Mailer\Bridge\Amazon\Transport\SesTransportFactory;
1718
use Symfony\Component\Mailer\Bridge\Azure\Transport\AzureTransportFactory;
1819
use Symfony\Component\Mailer\Bridge\Brevo\Transport\BrevoTransportFactory;
@@ -43,6 +44,7 @@ public static function setUpBeforeClass(): void
4344
{
4445
ClassExistsMock::register(__CLASS__);
4546
ClassExistsMock::withMockedClasses([
47+
AhaSendTransportFactory::class => false,
4648
AzureTransportFactory::class => false,
4749
BrevoTransportFactory::class => false,
4850
GmailTransportFactory::class => false,
@@ -79,6 +81,7 @@ public function testMessageWhereSchemeIsPartOfSchemeToPackageMap(string $scheme,
7981

8082
public static function messageWhereSchemeIsPartOfSchemeToPackageMapProvider(): \Generator
8183
{
84+
yield ['ahasend', 'symfony/ahasend-mailer'];
8285
yield ['azure', 'symfony/azure-mailer'];
8386
yield ['brevo', 'symfony/brevo-mailer'];
8487
yield ['gmail', 'symfony/google-mailer'];

Transport.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Psr\EventDispatcher\EventDispatcherInterface;
1515
use Psr\Log\LoggerInterface;
16+
use Symfony\Component\Mailer\Bridge\AhaSend\Transport\AhaSendTransportFactory;
1617
use Symfony\Component\Mailer\Bridge\Amazon\Transport\SesTransportFactory;
1718
use Symfony\Component\Mailer\Bridge\Azure\Transport\AzureTransportFactory;
1819
use Symfony\Component\Mailer\Bridge\Brevo\Transport\BrevoTransportFactory;
@@ -52,6 +53,7 @@
5253
final class Transport
5354
{
5455
private const FACTORY_CLASSES = [
56+
AhaSendTransportFactory::class,
5557
AzureTransportFactory::class,
5658
BrevoTransportFactory::class,
5759
GmailTransportFactory::class,

0 commit comments

Comments
 (0)