-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Mailer][Sendgrid] Support region
#58264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I think I am missing something, I am in trouble with the failing test |
Do we need this? We can set it via the host, right? |
src/Symfony/Component/Mailer/Bridge/Sendgrid/Tests/Transport/SendgridApiTransportTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Mailer/Bridge/Sendgrid/Tests/Transport/SendgridTransportFactoryTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Mailer/Bridge/Sendgrid/Transport/SendgridApiTransport.php
Outdated
Show resolved
Hide resolved
Probably yes (setting via the host). But this feel more convenient to use, and considering we are already providing this kind of interaction with host for some bridge (like Mailjet or Mailgun) I did not think it would be a problem |
@MrYamous for EU region we should use 'api.eu.sendgrid.com', but according to your logic |
src/Symfony/Component/Mailer/Bridge/Sendgrid/Transport/SendgridApiTransport.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Mailer/Bridge/Sendgrid/Transport/SendgridSmtpTransport.php
Show resolved
Hide resolved
src/Symfony/Component/Mailer/Bridge/Sendgrid/Tests/Transport/SendgridApiTransportTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Mailer/Bridge/Sendgrid/Transport/SendgridSmtpTransport.php
Show resolved
Hide resolved
src/Symfony/Component/Mailer/Bridge/Sendgrid/Tests/Transport/SendgridTransportFactoryTest.php
Outdated
Show resolved
Hide resolved
I think I am 👎 on this one, we can already achieve that by setting the correct host. |
@OskarStark for providers that have the concept of multiple regions, we support that natively in other bridges. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me once comments have been addressed.
I will take care of that over the weekend :) |
0508e51
to
2b6c459
Compare
Thank you @MrYamous. |
region
{ | ||
parent::__construct('smtp.sendgrid.net', 465, true, $dispatcher, $logger); | ||
parent::__construct('null' !== $region ? \sprintf('smtp.%s.sendgrid.net', $region) : 'smtp.sendgrid.net', 465, true, $dispatcher, $logger); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to comment on a merged PR, but I'm not sure this works as intended: we noticed mails were not being sent after upgrading to 7.2. Our region was null
at this point, but the check is performed using 'null'
(as a string). So this ended up as the following error:
Connection could not be established with host "ssl://smtp..sendgrid.net:465": stream_socket_client(): php_network_getaddresses: getaddrinfo for smtp..sendgrid.net failed: Name does not resolve
After appending ?region=global
to the existing DSN it did work again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you confirm that #59099 fixes this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, missed that in my search. Yes that fixes it, thanks!
Still TODO