Skip to content

Commit

Permalink
Fix for Issue #419
Browse files Browse the repository at this point in the history
Fix for Issue #419
  • Loading branch information
Vijay committed Jul 24, 2017
1 parent a8cbf06 commit f5e90a9
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions wye/base/emailer_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,42 @@
def send_email_to_list(subject, body, users_list, text_body,
bcc_admins=True, bcc_managers=False):
bcc = []
if bcc_admins:
bcc += [email for name, email in settings.ADMINS] # @UnusedVariable
# if bcc_admins:
# bcc += [email for name, email in settings.ADMINS] # @UnusedVariable

if bcc_managers:
bcc += [email for name, email in settings.MANAGERS] # @UnusedVariable
# if bcc_managers:
# bcc += [email for name, email in settings.MANAGERS] # @UnusedVariable
from_user = 'PythonExpress <noreply@pythonexpress.in>'
email = EmailMultiAlternatives(
subject, text_body, from_user, users_list, bcc)
email.attach_alternative(body, "text/html")

EmailThread(email).start()
email = EmailMultiAlternatives(
subject, text_body, from_user, ['contact@pythonexpress.in'], bcc)
email.attach_alternative(body, "text/html")
EmailThread(email).start()


def send_email_to_id(subject, body, email_id, text_body,
bcc_admins=True, bcc_managers=False):
bcc = []
if bcc_admins:
bcc += [email for name, email in settings.ADMINS] # @UnusedVariable
# if bcc_admins:
# bcc += [email for name, email in settings.ADMINS] # @UnusedVariable

if bcc_managers:
bcc += [email for name, email in settings.MANAGERS] # @UnusedVariable
# if bcc_managers:
# bcc += [email for name, email in settings.MANAGERS] # @UnusedVariable

from_user = 'PythonExpress <noreply@pythonexpress.in>'
email = EmailMultiAlternatives(
subject, text_body, from_user, [email_id], bcc=bcc)
email.attach_alternative(body, "text/html")
EmailThread(email).start()
# EMail to Admins
email = EmailMultiAlternatives(
subject, text_body, from_user, ['contact@pythonexpress.in'], bcc)
email.attach_alternative(body, "text/html")
EmailThread(email).start()


class EmailThread(threading.Thread):
Expand Down

0 comments on commit f5e90a9

Please sign in to comment.