sendgrid-django icon indicating copy to clipboard operation
sendgrid-django copied to clipboard

'Mail' object has no attribute 'set_from' on sendgrid==4.2.0

Open cypreess opened this issue 7 years ago • 3 comments

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.

cypreess avatar Jun 26 '17 12:06 cypreess

Oh - I just spotted that this package is not compatible with sendgrid packages above version 4.

Is there any particular reason for that?

cypreess avatar Jun 26 '17 13:06 cypreess

The official sendgrid client for python( sengrid-python 4.2.0) has some changes but it's already updated in this PR #53

MIKNOTAURO avatar Jul 11 '17 13:07 MIKNOTAURO

Also resolved with further upgrade to 5.x.x in #69

jayhale avatar Sep 26 '17 01:09 jayhale