This commit is contained in:
ygm1881
2022-04-17 22:41:55 +08:00
parent 7015fd799d
commit 1c8a148c84
2 changed files with 28 additions and 9 deletions
+8 -8
View File
@@ -41,14 +41,14 @@ def send_code_email(email, send_type="register"):
email_title = ""
email_body = ""
# 如果为注册类型
if send_type == "register":
email_title = "注册激活"
# email_body = "请点击下面的链接激活你的账号:http://127.0.0.1:8000/active/{0}".format(code)
email_body = "您的邮箱注册验证码为:{0}, 该验证码有效时间为两分钟,请及时进行验证。".format(code)
# 发送邮件
send_status = send_mail(email_title, email_body, settings.EMAIL_FROM, [email])
if not send_status:
return False
# if send_type == "register":
# email_title = "注册激活"
# # email_body = "请点击下面的链接激活你的账号:http://127.0.0.1:8000/active/{0}".format(code)
# email_body = "您的邮箱注册验证码为:{0}, 该验证码有效时间为两分钟,请及时进行验证。".format(code)
# # 发送邮件
# send_status = send_mail(email_title, email_body, settings.EMAIL_FROM, [email])
# if not send_status:
# return False
if send_type == "retrieve":
email_title = "找回密码"
email_body = "您的邮箱注册验证码为:{0}, 该验证码有效时间为两分钟,请及时进行验证。".format(code)