sendgrid-django
sendgrid-django copied to clipboard
'Mail' object has no attribute 'set_from' on sendgrid==4.2.0
When using:
sendgrid==4.2.0
sendgrid-django==4.0.4
django=1.11.2
whenever I want to send e-mail I got error:
File "/app/.heroku/python/lib/python3.6/site-packages/django/core/mail/message.py" in send
348. return self.get_connection(fail_silently).send_messages([self])
File "/app/.heroku/python/lib/python3.6/site-packages/sgbackend/mail.py" in send_messages
66. mail = self._build_sg_mail(email)
File "/app/.heroku/python/lib/python3.6/site-packages/sgbackend/mail.py" in _build_sg_mail
82. mail.set_from(Email(from_email, from_name))
Exception Type: AttributeError at /auth/password/reset/
Exception Value: 'Mail' object has no attribute 'set_from'
Downgrading to sendgrid==3.6.3
solves issue.
Oh - I just spotted that this package is not compatible with sendgrid packages above version 4.
Is there any particular reason for that?
The official sendgrid client for python( sengrid-python 4.2.0) has some changes but it's already updated in this PR #53
Also resolved with further upgrade to 5.x.x in #69