From ca1b1032eb3a5e97f56774e34de5765b168b0798 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Tue, 8 Aug 2017 22:28:27 +0200 Subject: [PATCH] Allow mails without HTML --- src/pretix/base/services/mail.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pretix/base/services/mail.py b/src/pretix/base/services/mail.py index b4c9731e5..76a1c5ba6 100644 --- a/src/pretix/base/services/mail.py +++ b/src/pretix/base/services/mail.py @@ -143,7 +143,8 @@ def mail(email: str, subject: str, template: Union[str, LazyI18nString], def mail_send_task(to: List[str], subject: str, body: str, html: str, sender: str, event: int=None, headers: dict=None) -> bool: email = EmailMultiAlternatives(subject, body, sender, to=to, headers=headers) - email.attach_alternative(inline_css(html), "text/html") + if html is not None: + email.attach_alternative(inline_css(html), "text/html") if event: event = Event.objects.get(id=event) backend = event.get_mail_backend()