-
Notifications
You must be signed in to change notification settings - Fork 55
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
Support EU region endpoint #131
Conversation
@@ -212,7 +220,10 @@ def set_prop(attachment, prop_name, value): | |||
filename = f"part-{uuid.uuid4().hex}{ext}" | |||
set_prop(sg_attch, "filename", filename) | |||
# todo: Read content if stream? | |||
set_prop(sg_attch, "content", django_attch.get_payload().replace("\n", "")) | |||
payload = django_attch.get_payload() | |||
if isinstance(payload, str): |
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.
nice catch
@mikemanger have you tested this locally yourself? It's been a few years since I've had access to sendgrid, and the API key that I use for testing (stored as a secret in GitHub) is the only way I have to access the service without paying (I got it for free under some developer program when I first started this repo). |
Yes. I've fixed the secret For some reason it is now showing as skipping for the original |
I think I set it to only run on the main/master to avoid leaking the secret in PRs |
Adds
SENDGRID_HOST_URL
to configure the API's root URL. This fixes #129 by allowing people to change the default API endpoint.I thought about using the
set_sendgrid_data_residency()
method added in 6.10 (sendgrid/sendgrid-python#1073) however this works with all previous releases and should "just work" if they add more regions in the future.One downside is that to test this you need a separate subuser and API key - I've set this as
TESTING_SENDGRID_EU_API_KEY
.I didn't intend to include this but an edge case to the
get_payload()
not always returning string is checked before doing a string replace (this is highlighted in more recent versions of mypy).Feedback welcome.