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()
# ----------------------------------------------------------------------------------------------------------------------
评论列表
文章目录