Skip to content

Commit e1daf4e

Browse files
committed
bug symfony#61769 [Mailer][Sendgrid] Add support for global region (api transport) (sonnymilton)
This PR was merged into the 7.4 branch. Discussion ---------- [Mailer][Sendgrid] Add support for `global` region (api transport) | Q | A | ------------- | --- | Branch? | 7.4 | Bug fix? | no | New feature? | yes | Deprecations? | no | Issues | Fix symfony#61706 | License | MIT Related to symfony#61706 and symfony#61758 Add support for `global` region (`SendgridApiTransport`) Commits ------- 8eb5a45 [Mailer][Sendgrid] Add support for `global` region (api transport)
2 parents 1684c09 + 8eb5a45 commit e1daf4e

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)