-
Notifications
You must be signed in to change notification settings - Fork 78
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
Can't set reply-to neither by header nor explicitly #50
Comments
This looks like it's probably the same bug as #34. |
It is. I already made a workaround fix -which miss the possibility that reply-to email includes a name- in a forked repository of this one that includes inside _build_sg_mail
Thing is Django asks as reply_to for a tuple/list while sendgrid only accepts one email as reply_to. Do you know if the email specification allows multiple emails in Reply-to header? |
Our fix currently looks like this:
Based on the discussion in #34 I can't tell how close an actual fix here is. Happy to help/contribute a PR for this though. |
By running README example:
I get a 400 HTTP error
The thing is sendgrid-django has a set_reply_to method in the class Mail (https://github.com/sendgrid/sendgrid-python/blob/master/sendgrid/helpers/mail/mail.py#L154) while in sendgrid-django _build_sg_mail method (https://github.com/elbuo8/sendgrid-django/blob/master/sgbackend/mail.py#L69) reply_to is not added by the proper method, instead it expects to be added from setting a custom header like the example does:
Next problem is django EmailMessage class only accepts reply_to param a list/tuple (https://github.com/django/django/blob/1c466994d9729a8902d34e277a3a685bef2a08e1/django/core/mail/message.py#L232) while sengrid-python expects only as I see one single email as reply-to (https://github.com/sendgrid/sendgrid-python/blob/master/sendgrid/helpers/mail/mail.py#L85 and https://github.com/sendgrid/sendgrid-python/blob/ca96c8dcd66224e13b38ab8fd2d2b429dd07dd02/examples/mail/mail.py#L132)
The text was updated successfully, but these errors were encountered: