mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2025-08-17 19:31:18 +02:00
if files condition restored
This commit is contained in:
@ -120,12 +120,13 @@ def send_templated_mail(template_name,
|
|||||||
recipients, bcc=bcc)
|
recipients, bcc=bcc)
|
||||||
msg.attach_alternative(html_part, "text/html")
|
msg.attach_alternative(html_part, "text/html")
|
||||||
|
|
||||||
for filename, filefield in files:
|
if files:
|
||||||
if six.PY3:
|
for filename, filefield in files:
|
||||||
msg.attach_file(filefield.path)
|
if six.PY3:
|
||||||
else:
|
msg.attach_file(filefield.path)
|
||||||
with open(filefield.path, 'rb') as attachedfile:
|
else:
|
||||||
msg.attach(filename, attachedfile.read())
|
with open(filefield.path, 'rb') as attachedfile:
|
||||||
|
msg.attach(filename, attachedfile.read())
|
||||||
|
|
||||||
return msg.send(fail_silently)
|
return msg.send(fail_silently)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user