Skip to content

Commit

Permalink
feature #58698 [Mailer] Add AhaSend Bridge (farhadhf)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the 7.3 branch.

Discussion
----------

[Mailer] Add AhaSend Bridge

| Q             | A
| ------------- | ---
| Branch?       | 7.3
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Issues        |
| License       | MIT
| Doc PR | symfony/symfony-docs#20361
| Recipe PR | symfony/recipes#1350

This PR adds support for a new mail bridge for the [AhaSend](https://ahasend.com) email service.
It includes support for SMTP and API transports (along with support for attachments for the API transport), and both delivery and engagement webhooks.

Commits
-------

3dfad14c714 [Mailer] Add AhaSend Bridge
  • Loading branch information
fabpot committed Jan 5, 2025
2 parents 1017fe9 + 0f836d7 commit 7ec706b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Exception/UnsupportedSchemeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
class UnsupportedSchemeException extends LogicException
{
private const SCHEME_TO_PACKAGE_MAP = [
'ahasend' => [
'class' => Bridge\AhaSend\Transport\AhaSendTransportFactory::class,
'package' => 'symfony/ahasend-mailer',
],
'azure' => [
'class' => Bridge\Azure\Transport\AzureTransportFactory::class,
'package' => 'symfony/azure-mailer',
Expand Down
3 changes: 3 additions & 0 deletions Tests/Exception/UnsupportedSchemeExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ClassExistsMock;
use Symfony\Component\Mailer\Bridge\AhaSend\Transport\AhaSendTransportFactory;
use Symfony\Component\Mailer\Bridge\Amazon\Transport\SesTransportFactory;
use Symfony\Component\Mailer\Bridge\Azure\Transport\AzureTransportFactory;
use Symfony\Component\Mailer\Bridge\Brevo\Transport\BrevoTransportFactory;
Expand Down Expand Up @@ -43,6 +44,7 @@ public static function setUpBeforeClass(): void
{
ClassExistsMock::register(__CLASS__);
ClassExistsMock::withMockedClasses([
AhaSendTransportFactory::class => false,
AzureTransportFactory::class => false,
BrevoTransportFactory::class => false,
GmailTransportFactory::class => false,
Expand Down Expand Up @@ -79,6 +81,7 @@ public function testMessageWhereSchemeIsPartOfSchemeToPackageMap(string $scheme,

public static function messageWhereSchemeIsPartOfSchemeToPackageMapProvider(): \Generator
{
yield ['ahasend', 'symfony/ahasend-mailer'];
yield ['azure', 'symfony/azure-mailer'];
yield ['brevo', 'symfony/brevo-mailer'];
yield ['gmail', 'symfony/google-mailer'];
Expand Down
2 changes: 2 additions & 0 deletions Transport.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

use Psr\EventDispatcher\EventDispatcherInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\Mailer\Bridge\AhaSend\Transport\AhaSendTransportFactory;
use Symfony\Component\Mailer\Bridge\Amazon\Transport\SesTransportFactory;
use Symfony\Component\Mailer\Bridge\Azure\Transport\AzureTransportFactory;
use Symfony\Component\Mailer\Bridge\Brevo\Transport\BrevoTransportFactory;
Expand Down Expand Up @@ -52,6 +53,7 @@
final class Transport
{
private const FACTORY_CLASSES = [
AhaSendTransportFactory::class,
AzureTransportFactory::class,
BrevoTransportFactory::class,
GmailTransportFactory::class,
Expand Down

0 comments on commit 7ec706b

Please sign in to comment.