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 63ae307 + 6623abc commit 316cc8e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions DependencyInjection/FrameworkExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -2745,6 +2745,7 @@ private function registerMailerConfiguration(array $config, ContainerBuilder $co
}

$classToServices = [
MailerBridge\AhaSend\Transport\AhaSendTransportFactory::class => 'mailer.transport_factory.ahasend',
MailerBridge\Azure\Transport\AzureTransportFactory::class => 'mailer.transport_factory.azure',
MailerBridge\Brevo\Transport\BrevoTransportFactory::class => 'mailer.transport_factory.brevo',
MailerBridge\Google\Transport\GmailTransportFactory::class => 'mailer.transport_factory.gmail',
Expand Down Expand Up @@ -2775,6 +2776,7 @@ private function registerMailerConfiguration(array $config, ContainerBuilder $co

if ($webhookEnabled) {
$webhookRequestParsers = [
MailerBridge\AhaSend\Webhook\AhaSendRequestParser::class => 'mailer.webhook.request_parser.ahasend',
MailerBridge\Brevo\Webhook\BrevoRequestParser::class => 'mailer.webhook.request_parser.brevo',
MailerBridge\MailerSend\Webhook\MailerSendRequestParser::class => 'mailer.webhook.request_parser.mailersend',
MailerBridge\Mailchimp\Webhook\MailchimpRequestParser::class => 'mailer.webhook.request_parser.mailchimp',
Expand Down
2 changes: 2 additions & 0 deletions Resources/config/mailer_transports.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

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 @@ -47,6 +48,7 @@
->tag('monolog.logger', ['channel' => 'mailer']);

$factories = [
'ahasend' => AhaSendTransportFactory::class,
'amazon' => SesTransportFactory::class,
'azure' => AzureTransportFactory::class,
'brevo' => BrevoTransportFactory::class,
Expand Down
7 changes: 7 additions & 0 deletions Resources/config/mailer_webhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use Symfony\Component\Mailer\Bridge\AhaSend\RemoteEvent\AhaSendPayloadConverter;
use Symfony\Component\Mailer\Bridge\AhaSend\Webhook\AhaSendRequestParser;
use Symfony\Component\Mailer\Bridge\Brevo\RemoteEvent\BrevoPayloadConverter;
use Symfony\Component\Mailer\Bridge\Brevo\Webhook\BrevoRequestParser;
use Symfony\Component\Mailer\Bridge\Mailchimp\RemoteEvent\MailchimpPayloadConverter;
Expand Down Expand Up @@ -86,6 +88,11 @@
->args([service('mailer.payload_converter.sweego')])
->alias(SweegoRequestParser::class, 'mailer.webhook.request_parser.sweego')

->set('mailer.payload_converter.ahasend', AhaSendPayloadConverter::class)
->set('mailer.webhook.request_parser.ahasend', AhaSendRequestParser::class)
->args([service('mailer.payload_converter.ahasend')])
->alias(AhaSendRequestParser::class, 'mailer.webhook.request_parser.ahasend')

->set('mailer.payload_converter.mailchimp', MailchimpPayloadConverter::class)
->set('mailer.webhook.request_parser.mailchimp', MailchimpRequestParser::class)
->args([service('mailer.payload_converter.mailchimp')])
Expand Down

0 comments on commit 316cc8e

Please sign in to comment.