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

AttributeError: 'Mail' object has no attribute 'set_template_id'

Open bmull opened this issue 2 years ago • 2 comments

I'm following instructions from the README, using Django 3.1.6, Python 3.7.7, django-sendgrid-v5==0.6.8 and tried to send an email with a template ID. I get the error AttributeError: 'Mail' object has no attribute 'set_template_id'

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/.../venv/lib/python3.7/site-packages/django/core/mail/message.py", line 284, in send
    return self.get_connection(fail_silently).send_messages([self])
  File "/.../venv/lib/python3.7/site-packages/sendgrid_backend/mail.py", line 52, in send_messages
    data = self._build_sg_mail(msg)
  File "/.../venv/lib/python3.7/site-packages/sendgrid_backend/mail.py", line 93, in _build_sg_mail
    mail.set_template_id(msg.template_id)
AttributeError: 'Mail' object has no attribute 'set_template_id'

bmull avatar Mar 02 '22 06:03 bmull

I recommend upgrading to a more recent version of django-sendgrid-v5 to ensure compatibility with more recent django apis

On Mar 2, 2022, at 1:13 AM, Brenden Mulligan @.***> wrote:

 I'm following instructions from the README, using Django 3.1.6, Python 3.7.7, django-sendgrid-v5==0.6.8 and tried to send an email with a template ID. I get the error AttributeError: 'Mail' object has no attribute 'set_template_id'

Traceback (most recent call last): File "", line 1, in File "/.../venv/lib/python3.7/site-packages/django/core/mail/message.py", line 284, in send return self.get_connection(fail_silently).send_messages([self]) File "/.../venv/lib/python3.7/site-packages/sendgrid_backend/mail.py", line 52, in send_messages data = self._build_sg_mail(msg) File "/.../venv/lib/python3.7/site-packages/sendgrid_backend/mail.py", line 93, in _build_sg_mail mail.set_template_id(msg.template_id) AttributeError: 'Mail' object has no attribute 'set_template_id' — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.

sklarsa avatar Mar 02 '22 13:03 sklarsa

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 04 '22 01:06 stale[bot]