fix: 邮件主题前缀设置不生效的问题

pull/10998/head
halo 2023-07-13 21:50:17 +08:00 committed by Bryan
parent 539babcc97
commit 27c10fcae1
2 changed files with 2 additions and 0 deletions

View File

@ -49,6 +49,7 @@ def send_mail_attachment_async(subject, message, recipient_list, attachment_list
if attachment_list is None: if attachment_list is None:
attachment_list = [] attachment_list = []
from_email = settings.EMAIL_FROM or settings.EMAIL_HOST_USER from_email = settings.EMAIL_FROM or settings.EMAIL_HOST_USER
subject = (settings.EMAIL_SUBJECT_PREFIX or '') + subject
email = EmailMultiAlternatives( email = EmailMultiAlternatives(
subject=subject, subject=subject,
body=message, body=message,

View File

@ -11,6 +11,7 @@ class Email(BackendBase):
def send_msg(self, users, message, subject): def send_msg(self, users, message, subject):
from_email = settings.EMAIL_FROM or settings.EMAIL_HOST_USER from_email = settings.EMAIL_FROM or settings.EMAIL_HOST_USER
accounts, __, __ = self.get_accounts(users) accounts, __, __ = self.get_accounts(users)
subject = (settings.EMAIL_SUBJECT_PREFIX or '') + subject
send_mail(subject, message, from_email, accounts, html_message=message) send_mail(subject, message, from_email, accounts, html_message=message)