-
Notifications
You must be signed in to change notification settings - Fork 223
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
Fix/return path #276
Fix/return path #276
Conversation
Co-authored-by: Breno Viana <brenomfviana@gmail.com>
@@ -38,6 +38,7 @@ | |||
AWS_SES_RETURN_PATH_ARN = getattr(settings, 'AWS_SES_RETURN_PATH_ARN', None) | |||
|
|||
USE_SES_V2 = getattr(settings, 'USE_SES_V2', False) | |||
AWS_SES_FROM_EMAIL = getattr(settings, 'AWS_SES_FROM_EMAIL', None) |
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.
So this is a breaking change, as it changes what AWS_SES_RETURN_PATH
is used for right?
What happens to an existing project if they upgrade to this new version but don't declare AWS_SES_FROM_EMAIL
? Will something break?
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.
Yes.
It will cause a breaking change on the following scenery
AWS_SES_RETURN_PATH = "my_default_from_email@email.com"
SESBackend().send_messages(
[
{
"from": "ignored_from_email@email.com",
"to": "to_email@email.com",
"subject": "some subject",
"message": "some message"
}
]
)
Before this change, this message would be sent with the FromEmailAddress=my_default_from_email@email.com
.
After this change, if the attribute AWS_SES_FROM_EMAIL
is not set with AWS_SES_FROM_EMAIL=my_default_from_email@email.com
, the email will be sent with the from email of the EmailMessage, which would be FromEmailAddress=ignored_from_email@email.com
.
The correct usage AFTER THE CHANGE would be
AWS_SES_FROM_EMAIL = "my_default_from_email@email.com"
SESBackend().send_messages(
[
{
"from": "ignored_from_email@email.com",
"to": "to_email@email.com",
"subject": "some subject",
"message": "some message"
}
]
)
And this scenery could be a test itself! And it could act as a regression test.
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.
If you don't mind, please add this example to the PR description and update the changelog, that will make it easier to merge this PR!
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.
Will do!
README.rst
Outdated
``AWS_SES_RETURN_PATH`` | ||
Instruct Amazon SES to forward bounced emails and complaints to this email. | ||
``AWS_SES_FROM_EMAIL`` | ||
Optional. The email addres to be used as the "From" address for the email. The address that you specify has to be verified. | ||
For more information please refer to http://aws.amazon.com/ses/faqs/#38 |
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.
Looks like this link needs to be updated
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.
are you talking about this link?
For more information please refer to http://aws.amazon.com/ses/faqs/#38 | |
For more information please refer to http://aws.amazon.com/ses/faqs/#38 |
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.
Yes, it doesn't go to any specific question (#38
)
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.
I read it and didn't find anything on it.
We could use the boto recommendation. What do you think?
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.
Yes, seems like a more fitting link! Thank you for suggesting
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.
Just small changes and suggestion to update with an example.
I think this can be merged and I will bump only a minor version, though there is a risk we would get some complaints as people upgrade. So I want to have a very clear explanation in the changelog and link to this PR, so people can understand why we're changing how this setting behaves.
Thanks for working on this!
Co-authored-by: Paul Craciunoiu <paul@uplift.ltd>
Co-authored-by: Paul Craciunoiu <paul@uplift.ltd>
Co-authored-by: Rodrigo Castro <rodrigondec@gmail.com>
Co-authored-by: Rodrigo Castro <rodrigondec@gmail.com>
Looks like tests are failing now. Let me know when it's ready! |
I made the changes (PR description and link change). Anything else? Before being merged? |
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.
Alright let's give this a go! I'll update the changelog.
This has been released in v3.4.0 - https://pypi.org/project/django-ses/3.4.0/ |
After seeing the issues cited in the issue #274. It was seen that AWS_SES_RETURN_PATH was not working as it should.
How to solve the problem of receivaing emails
We create a configuration to add an e-mail that receives feedback:
AWS_SES_FROM_EMAIL
Why do we do this?
Before, we had it
django-ses/django_ses/__init__.py
Line 130 in 5dc270e
However
django-ses/README.rst
Lines 482 to 484 in 5dc270e
The source had a use improper. Source to be used as the "From" address for the email. As the documentation says
How is the "From address email"?
AWS_SES_FROM_EMAIL
has been added to solve the problem.Tests
It was added some tests, but, i am open to hearing other cases to be reproduced
Drastic changes by @rodrigondec
Answer to question AWS_SES_FROM_EMAIL