Skip to content

Commit

Permalink
bug #52268 [Mailer][Notifier] Update Sendinblue / Brevo API host (Ste…
Browse files Browse the repository at this point in the history
…phanie)

This PR was merged into the 5.4 branch.

Discussion
----------

[Mailer][Notifier] Update Sendinblue / Brevo API host

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fix #52264
| License       | MIT

Sendinblue rebrands to Brevo, and it simultaneously upgrade smtp and API servers.
There are 2 distincts API currently : api.sendinblue.com (deprecated but still running) and api.brevo.com (the one to use)
Unlike SMTP host, API host is not changed on LTS 5.4 and are still set to api.sendinblue.com.

Commits
-------

554e9cc [Mailer] [Notifier] #52264 Update Sendinblue / Brevo API host
  • Loading branch information
nicolas-grekas committed Oct 24, 2023
2 parents b769b77 + 554e9cc commit a289293
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static function getTransportData()
{
yield [
new SendinblueApiTransport('ACCESS_KEY'),
'sendinblue+api://api.sendinblue.com',
'sendinblue+api://api.brevo.com',
];

yield [
Expand Down Expand Up @@ -89,7 +89,7 @@ public function testSendThrowsForErrorResponse()
{
$client = new MockHttpClient(function (string $method, string $url, array $options): ResponseInterface {
$this->assertSame('POST', $method);
$this->assertSame('https://api.sendinblue.com:8984/v3/smtp/email', $url);
$this->assertSame('https://api.brevo.com:8984/v3/smtp/email', $url);
$this->assertStringContainsString('Accept: */*', $options['headers'][2] ?? $options['request_headers'][1]);

return new MockResponse(json_encode(['message' => 'i\'m a teapot']), [
Expand Down Expand Up @@ -119,7 +119,7 @@ public function testSend()
{
$client = new MockHttpClient(function (string $method, string $url, array $options): ResponseInterface {
$this->assertSame('POST', $method);
$this->assertSame('https://api.sendinblue.com:8984/v3/smtp/email', $url);
$this->assertSame('https://api.brevo.com:8984/v3/smtp/email', $url);
$this->assertStringContainsString('Accept: */*', $options['headers'][2] ?? $options['request_headers'][1]);

return new MockResponse(json_encode(['messageId' => 'foobar']), [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,6 @@ private function stringifyAddress(Address $address): array

private function getEndpoint(): ?string
{
return ($this->host ?: 'api.sendinblue.com').($this->port ? ':'.$this->port : '');
return ($this->host ?: 'api.brevo.com').($this->port ? ':'.$this->port : '');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/
final class SendinblueTransport extends AbstractTransport
{
protected const HOST = 'api.sendinblue.com';
protected const HOST = 'api.brevo.com';

private $apiKey;
private $sender;
Expand Down

0 comments on commit a289293

Please sign in to comment.