notify_due_actions.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:balafon 作者: ljean 项目源码 文件源码
def notify_due_actions(user, actions):
    """send message by email"""

    notification_email = user.email
    from_email = settings.DEFAULT_FROM_EMAIL

    data = {
        'user': user,
        'actions': actions,
        'site': settings.COOP_CMS_SITE_PREFIX,
    }
    template = get_template('Users/due_actions_notification_email.txt')
    content = template.render(Context(data))

    email = EmailMessage(
        _(u"Balafon: You have due actions"),
        content,
        from_email,
        [notification_email]
    )

    try:
        email.send()
    except Exception:  #pylint: disable=broad-except
        logger.exception("notify_due_actions")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号