Skip to content

Commit

Permalink
feature #50302 [Mailer] New Brevo mailer bridge (formerly Sendinblue)…
Browse files Browse the repository at this point in the history
… (PEtanguy)

This PR was squashed before being merged into the 6.4 branch.

Discussion
----------

[Mailer] New Brevo mailer bridge (formerly Sendinblue)

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | N/A
| License       | MIT
| Doc PR        | TODO

Hello,

This PR is aimed at updating the config for the sendinblue mailer.
As you might have seen, Sendinblue has rebranded to [Brevo](https://developers.brevo.com/) and also rewrote their apis.
This change ensure compatibility with the new endpoints and removes any reference to Sendinblue.

This is the notifier PR: symfony/symfony#50296

Commits
-------

f537358e5a [Mailer] New Brevo mailer bridge (formerly Sendinblue)
  • Loading branch information
fabpot committed Jul 9, 2023
2 parents 5b26624 + 1e414e8 commit 82466d3
Show file tree
Hide file tree
Showing 2 changed files with 7 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 = [
'brevo' => [
'class' => Bridge\Brevo\Transport\BrevoTransportFactory::class,
'package' => 'symfony/brevo-mailer',
],
'gmail' => [
'class' => Bridge\Google\Transport\GmailTransportFactory::class,
'package' => 'symfony/google-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 @@ -14,6 +14,7 @@
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ClassExistsMock;
use Symfony\Component\Mailer\Bridge\Amazon\Transport\SesTransportFactory;
use Symfony\Component\Mailer\Bridge\Brevo\Transport\BrevoTransportFactory;
use Symfony\Component\Mailer\Bridge\Google\Transport\GmailTransportFactory;
use Symfony\Component\Mailer\Bridge\Infobip\Transport\InfobipTransportFactory;
use Symfony\Component\Mailer\Bridge\Mailchimp\Transport\MandrillTransportFactory;
Expand All @@ -36,6 +37,7 @@ public static function setUpBeforeClass(): void
{
ClassExistsMock::register(__CLASS__);
ClassExistsMock::withMockedClasses([
BrevoTransportFactory::class => false,
GmailTransportFactory::class => false,
InfobipTransportFactory::class => false,
MailerSendTransportFactory::class => false,
Expand Down Expand Up @@ -65,6 +67,7 @@ public function testMessageWhereSchemeIsPartOfSchemeToPackageMap(string $scheme,

public static function messageWhereSchemeIsPartOfSchemeToPackageMapProvider(): \Generator
{
yield ['brevo', 'symfony/brevo-mailer'];
yield ['gmail', 'symfony/google-mailer'];
yield ['infobip', 'symfony/infobip-mailer'];
yield ['mailersend', 'symfony/mailersend-mailer'];
Expand Down

0 comments on commit 82466d3

Please sign in to comment.