fixed mailer to send mails in batches
This commit is contained in:
parent
10050cc4e9
commit
8d97183dd3
|
@ -214,7 +214,9 @@ def sendEmail(email_to, subject, data, template, attachment_jnf_response=None):
|
||||||
else:
|
else:
|
||||||
recipient_list = [str(email_to), ]
|
recipient_list = [str(email_to), ]
|
||||||
|
|
||||||
msg = EmailMultiAlternatives(subject, text_content, email_from,None,bcc=recipient_list)
|
#batch 100 ppl to send as bcc
|
||||||
|
for i in range(0,len(recipient_list),100):
|
||||||
|
msg = EmailMultiAlternatives(subject, text_content, email_from,None,bcc=recipient_list[i:i+100])
|
||||||
msg.attach_alternative(html_content, "text/html")
|
msg.attach_alternative(html_content, "text/html")
|
||||||
if attachment_jnf_response:
|
if attachment_jnf_response:
|
||||||
# logger.info(attachment_jnf_response)
|
# logger.info(attachment_jnf_response)
|
||||||
|
|
Loading…
Reference in New Issue