You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
602 B
19 lines
602 B
#!/usr/bin/env python
|
|
# -*- coding:utf-8 -*-
|
|
# project: fir_ser
|
|
# filename: wx
|
|
# author: liuyu
|
|
# data: 2022/3/23
|
|
import logging
|
|
|
|
from api.utils.modelutils import get_notify_email_queryset
|
|
from common.utils.sendmsg import get_sender_email_token
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
def notify_by_email(user_obj, message_type, msg='', html=None):
|
|
for notify_email in get_notify_email_queryset(user_obj, message_type):
|
|
email = notify_email.get('email')
|
|
if email:
|
|
get_sender_email_token('email', email, 'msg', html if html else f'您好,{user_obj.first_name},{msg}')
|
|
|