RyanBalfanz / django-sendgrid

SendGrid for Django
http://pypi.python.org/pypi/django-sendgrid
97 stars 26 forks source link

list index out of range #77

Open vinay-vik opened 7 years ago

vinay-vik commented 7 years ago

I have written a code to generate mails for multiple recipients using the following code.

sendGridEmail = SendGridEmailMultiAlternatives(subject,message,from_email,recipient_list) sendGridEmail.attach_alternative(mail_content, "text/html") sendGridEmail.sendgrid_headers.addTo(to_send_email_list) sendGridEmail.sendgrid_headers.addSubVal('%investor%', name_list) sendGridEmail.update_headers() response = sendGridEmail.send()

where recipient_list is empty and I want to update recipient_list using sendgrid_headers.addTo(to_send_email_list). I am not able to send mail because of empty list(recipient_list). Is there any way to update sendgrid_headers.addTo and send mails.

Thanks