Never fail to send an email because of missing attachments

This commit is contained in:
Raphael Michel
2018-10-05 09:33:40 +02:00
parent 14db654681
commit bd772bf900

View File

@@ -206,11 +206,14 @@ def mail_send_task(*args, to: List[str], subject: str, body: str, html: str, sen
else:
if attach_tickets:
for name, ct in get_tickets_for_order(order):
email.attach(
name,
ct.file.read(),
ct.type
)
try:
email.attach(
name,
ct.file.read(),
ct.type
)
except:
pass
email = email_filter.send_chained(event, 'message', message=email, order=order)