Skip to content

Commit 8eb5a45

Browse files
committed
[Mailer][Sendgrid] Add support for global region (api transport)
1 parent 1684c09 commit 8eb5a45

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Symfony/Component/Mailer/Bridge/Sendgrid/Tests/Transport/SendgridApiTransportTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ public static function getTransportData()
4343
new SendgridApiTransport('KEY', null, null, null, 'eu'),
4444
'sendgrid+api://api.eu.sendgrid.com',
4545
],
46+
[
47+
new SendgridApiTransport('KEY', null, null, null, 'global'),
48+
'sendgrid+api://api.sendgrid.com',
49+
],
4650
[
4751
(new SendgridApiTransport('KEY'))->setHost('example.com'),
4852
'sendgrid+api://example.com',

src/Symfony/Component/Mailer/Bridge/Sendgrid/Transport/SendgridApiTransport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ private function getAttachments(Email $email): array
199199
private function getEndpoint(): ?string
200200
{
201201
$host = $this->host ?: str_replace('%region_dot%', '', self::HOST);
202-
if (null !== $this->region && null === $this->host) {
202+
if (null !== $this->region && 'global' !== $this->region && null === $this->host) {
203203
$host = str_replace('%region_dot%', $this->region.'.', self::HOST);
204204
}
205205

0 commit comments

Comments
 (0)