Skip to content

Commit 3dfad14

Browse files
farhadhffabpot
authored andcommitted
[Mailer] Add AhaSend Bridge
1 parent 91588b3 commit 3dfad14

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1352
-0
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2670,6 +2670,7 @@ private function registerMailerConfiguration(array $config, ContainerBuilder $co
26702670
}
26712671

26722672
$classToServices = [
2673+
MailerBridge\AhaSend\Transport\AhaSendTransportFactory::class => 'mailer.transport_factory.ahasend',
26732674
MailerBridge\Azure\Transport\AzureTransportFactory::class => 'mailer.transport_factory.azure',
26742675
MailerBridge\Brevo\Transport\BrevoTransportFactory::class => 'mailer.transport_factory.brevo',
26752676
MailerBridge\Google\Transport\GmailTransportFactory::class => 'mailer.transport_factory.gmail',
@@ -2700,6 +2701,7 @@ private function registerMailerConfiguration(array $config, ContainerBuilder $co
27002701

27012702
if ($webhookEnabled) {
27022703
$webhookRequestParsers = [
2704+
MailerBridge\AhaSend\Webhook\AhaSendRequestParser::class => 'mailer.webhook.request_parser.ahasend',
27032705
MailerBridge\Brevo\Webhook\BrevoRequestParser::class => 'mailer.webhook.request_parser.brevo',
27042706
MailerBridge\MailerSend\Webhook\MailerSendRequestParser::class => 'mailer.webhook.request_parser.mailersend',
27052707
MailerBridge\Mailchimp\Webhook\MailchimpRequestParser::class => 'mailer.webhook.request_parser.mailchimp',

src/Symfony/Bundle/FrameworkBundle/Resources/config/mailer_transports.php

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

1212
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
1313

14+
use Symfony\Component\Mailer\Bridge\AhaSend\Transport\AhaSendTransportFactory;
1415
use Symfony\Component\Mailer\Bridge\Amazon\Transport\SesTransportFactory;
1516
use Symfony\Component\Mailer\Bridge\Azure\Transport\AzureTransportFactory;
1617
use Symfony\Component\Mailer\Bridge\Brevo\Transport\BrevoTransportFactory;
@@ -47,6 +48,7 @@
4748
->tag('monolog.logger', ['channel' => 'mailer']);
4849

4950
$factories = [
51+
'ahasend' => AhaSendTransportFactory::class,
5052
'amazon' => SesTransportFactory::class,
5153
'azure' => AzureTransportFactory::class,
5254
'brevo' => BrevoTransportFactory::class,

src/Symfony/Bundle/FrameworkBundle/Resources/config/mailer_webhook.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
1313

14+
use Symfony\Component\Mailer\Bridge\AhaSend\RemoteEvent\AhaSendPayloadConverter;
15+
use Symfony\Component\Mailer\Bridge\AhaSend\Webhook\AhaSendRequestParser;
1416
use Symfony\Component\Mailer\Bridge\Brevo\RemoteEvent\BrevoPayloadConverter;
1517
use Symfony\Component\Mailer\Bridge\Brevo\Webhook\BrevoRequestParser;
1618
use Symfony\Component\Mailer\Bridge\Mailchimp\RemoteEvent\MailchimpPayloadConverter;
@@ -86,6 +88,11 @@
8688
->args([service('mailer.payload_converter.sweego')])
8789
->alias(SweegoRequestParser::class, 'mailer.webhook.request_parser.sweego')
8890

91+
->set('mailer.payload_converter.ahasend', AhaSendPayloadConverter::class)
92+
->set('mailer.webhook.request_parser.ahasend', AhaSendRequestParser::class)
93+
->args([service('mailer.payload_converter.ahasend')])
94+
->alias(AhaSendRequestParser::class, 'mailer.webhook.request_parser.ahasend')
95+
8996
->set('mailer.payload_converter.mailchimp', MailchimpPayloadConverter::class)
9097
->set('mailer.webhook.request_parser.mailchimp', MailchimpRequestParser::class)
9198
->args([service('mailer.payload_converter.mailchimp')])
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/Tests export-ignore
2+
/phpunit.xml.dist export-ignore
3+
/.git* export-ignore

src/Symfony/Component/Mailer/Bridge/AhaSend/.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Symfony/Component/Mailer/Bridge/AhaSend/.github/workflows/close-pull-request.yml

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
vendor/
2+
composer.lock
3+
phpunit.xml
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CHANGELOG
2+
=========
3+
4+
7.3
5+
---
6+
* Add the bridge
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Mailer\Bridge\AhaSend\Event;
13+
14+
class AhaSendDeliveryEvent
15+
{
16+
public function __construct(
17+
private readonly string $message,
18+
) {
19+
}
20+
21+
public function getMessage(): string
22+
{
23+
return $this->message;
24+
}
25+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2024-present Fabien Potencier
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is furnished
8+
to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

0 commit comments

Comments
 (0)