diff --git a/symposion/utils/mail.py b/symposion/utils/mail.py index dc85687178da8d70bff0b0706a35ce87194e7642..59cdf09c7281efaf3ed9136aa0e82d1dfd40b093 100644 --- a/symposion/utils/mail.py +++ b/symposion/utils/mail.py @@ -7,9 +7,9 @@ from django.contrib.sites.models import Site def send_email(to, kind, **kwargs): - + current_site = Site.objects.get_current() - + ctx = { "current_site": current_site, "STATIC_URL": settings.STATIC_URL, @@ -19,12 +19,12 @@ def send_email(to, kind, **kwargs): current_site.name, render_to_string("emails/%s/subject.txt" % kind, ctx).strip() ) - + message_html = render_to_string("emails/%s/message.html" % kind, ctx) message_plaintext = strip_tags(message_html) - + from_email = settings.DEFAULT_FROM_EMAIL - + email = EmailMultiAlternatives(subject, message_plaintext, from_email, to) email.attach_alternative(message_html, "text/html") email.send()