tasks.py 文件源码

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

项目:Plamber 作者: OlegKlimenko 项目源码 文件源码
def restore_account(username, temp_password, recipient):
    """
    Celery task for sending mail on restore user data.

    :param str username:       The restored username.
    :param str temp_password:  The temporary password for restored username.
    :param str recipient:      The mail recipient.
    """
    html_content = render_to_string('mails/account_restore.html', {'username': username, 'password': temp_password})
    text_content = strip_tags(html_content)
    subject = '?????????????? ????????'

    email = EmailMultiAlternatives(subject, text_content, to=[recipient])
    email.attach_alternative(html_content, 'text/html')
    email.send()


# ----------------------------------------------------------------------------------------------------------------------
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号