mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-05-15 19:40:36 +00:00
* 添加站内信 * s * s * 添加接口 * fix * fix * 重构了一些 * 完成 * 完善 * s * s * s * s * s * s * 测试ok * 替换业务中发送消息的方式 * 修改 * s * 去掉 update 兼容 create * 添加 unread total 接口 * 调整json字段 Co-authored-by: xinwen <coderWen@126.com>
15 lines
440 B
Python
15 lines
440 B
Python
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'
|
|
|
|
def send_msg(self, users, subject, message):
|
|
from_email = settings.EMAIL_FROM or settings.EMAIL_HOST_USER
|
|
accounts, __, __ = self.get_accounts(users)
|
|
send_mail(subject, message, from_email, accounts)
|