Commit 81ee0558 authored by Cornee Traas's avatar Cornee Traas
Browse files

Fix html in registration email

parent 87d6a7b9
......@@ -56,13 +56,18 @@ class UserSerializer(serializers.ModelSerializer):
}
subject = "An account has been created"
body = loader.render_to_string(
html_content = loader.render_to_string(
"registration/password_reset_email.html", context
)
text_content = strip_tags(html_content)
email_message = EmailMultiAlternatives(
subject, body, from_email=settings.DEFAULT_FROM_EMAIL, to=[user.email]
subject,
text_content,
from_email=settings.DEFAULT_FROM_EMAIL,
to=[user.email],
)
email_message.attach_alternative(html_content, "text/html")
email_message.send()
return user
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment