lots a small stuff
This commit is contained in:
@@ -81,19 +81,19 @@ def send_template_email(from_email,to_email,subject,
|
||||
# html_content = newlinetobr(html_content)
|
||||
|
||||
|
||||
if 'bcc' in kwargs and 'cc' in kwargs:
|
||||
if 'bcc' in kwargs and 'cc' in kwargs: # pragma: no cover
|
||||
msg = EmailMultiAlternatives(subject, text_content, from_email, to_email,cc=kwargs['cc'],
|
||||
bcc=kwargs['bcc'])
|
||||
elif 'bcc' in kwargs:
|
||||
elif 'bcc' in kwargs: # pragma: no cover
|
||||
msg = EmailMultiAlternatives(subject, text_content, from_email, to_email,bcc=kwargs['bcc'])
|
||||
elif 'cc' in kwargs:
|
||||
elif 'cc' in kwargs: # pragma: no cover
|
||||
msg = EmailMultiAlternatives(subject, text_content, from_email, to_email,cc=kwargs['cc'])
|
||||
else:
|
||||
msg = EmailMultiAlternatives(subject, text_content, from_email, to_email)
|
||||
|
||||
msg.attach_alternative(html_content, "text/html")
|
||||
|
||||
if 'attach_file' in kwargs:
|
||||
if 'attach_file' in kwargs: # pragma: no cover
|
||||
fileobj = kwargs['attach_file']
|
||||
if os.path.isfile(fileobj):
|
||||
msg.attach_file(fileobj)
|
||||
@@ -107,7 +107,7 @@ def send_template_email(from_email,to_email,subject,
|
||||
except IOError:
|
||||
pass
|
||||
|
||||
if 'emailbounced' in kwargs:
|
||||
if 'emailbounced' in kwargs: # pragma: no cover
|
||||
emailbounced = kwargs['emailbounced']
|
||||
else:
|
||||
emailbounced = False
|
||||
@@ -116,7 +116,7 @@ def send_template_email(from_email,to_email,subject,
|
||||
|
||||
if not emailbounced:
|
||||
res = msg.send()
|
||||
else:
|
||||
else: # pragma: no cover
|
||||
return 0
|
||||
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user