2021-05-31 09:20:38 +00:00
|
|
|
from django.conf import settings
|
|
|
|
from django.core.mail import send_mail
|
|
|
|
|
|
|
|
from .base import BackendBase
|
|
|
|
|
|
|
|
|
|
|
|
class Email(BackendBase):
|
|
|
|
account_field = 'email'
|
|
|
|
is_enable_field_in_settings = 'EMAIL_HOST_USER'
|
|
|
|
|
2021-08-24 06:20:54 +00:00
|
|
|
def send_msg(self, users, message, subject):
|
2021-05-31 09:20:38 +00:00
|
|
|
from_email = settings.EMAIL_FROM or settings.EMAIL_HOST_USER
|
|
|
|
accounts, __, __ = self.get_accounts(users)
|
2021-06-17 04:19:05 +00:00
|
|
|
send_mail(subject, message, from_email, accounts, html_message=message)
|
2021-08-24 06:20:54 +00:00
|
|
|
|
|
|
|
|
|
|
|
backend = Email
|