def send_email(self, rendered_notification, notification):
from django.utils.safestring import SafeText
assert (isinstance(rendered_notification, SafeText))
try:
# TODO: send_mass_mail to send to multiple recipients
# mail_managers(u'{}'.format(notification.title),
# u'{}'.format(''),
# fail_silently=False, html_message=rendered_notification)
send_mail('%s%s' % (settings.EMAIL_SUBJECT_PREFIX, notification.title),
u'{}'.format(''),
from_email=settings.SERVER_EMAIL,
recipient_list=[self.email_to, ],
fail_silently=False,
html_message=rendered_notification)
except Exception as e:
raise e
评论列表
文章目录