AbstractUser sends plain email, while Django has html emails.
Why not make user.email_user() method in AbstractUser work with EmailMultiAlternatives?
Code example:
Additional imports:
from django.utils.html import strip_tags
from django.core.mail import EmailMultiAlternatives
class AbstractUser(AbstractBaseUser, PermissionsMixin):
# rest of the stuff of the AbstractUser
def email_user(self, subject, message, from_email=None, **kwargs):
“”“Send an email to this user.”""
message_alternative = strip_tags(message)
mail = EmailMultiAlternatives(subject, message, from_email, [self.email], **kwargs)
mail.attach_alternative(message_alternative, “text/html”)
mail.send()