forked from CGM_Public/pretix_original
Allow mails without HTML
This commit is contained in:
@@ -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,
|
def mail_send_task(to: List[str], subject: str, body: str, html: str, sender: str,
|
||||||
event: int=None, headers: dict=None) -> bool:
|
event: int=None, headers: dict=None) -> bool:
|
||||||
email = EmailMultiAlternatives(subject, body, sender, to=to, headers=headers)
|
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:
|
if event:
|
||||||
event = Event.objects.get(id=event)
|
event = Event.objects.get(id=event)
|
||||||
backend = event.get_mail_backend()
|
backend = event.get_mail_backend()
|
||||||
|
|||||||
Reference in New Issue
Block a user