def changed_password(username, recipient):
"""
Celery task for sending mail, to notify user about password changed.
:param str username: The restored username.
:param str recipient: The mail recipient.
"""
html_content = render_to_string('mails/password_changed.html', {'username': username})
text_content = strip_tags(html_content)
subject = '????????? ?????? ????????'
email = EmailMultiAlternatives(subject, text_content, to=[recipient])
email.attach_alternative(html_content, 'text/html')
email.send()
# ----------------------------------------------------------------------------------------------------------------------
评论列表
文章目录