def resend_mail(): token = current_user.generate_confirmed_token() send_mail(current_app.config["GRADUATION_MAIL_SUBJECT_PREFIX"] + "Confirm account", current_app.config["GRADUATION_MAIL_SENDER"], [current_user.email], "auth/confirm_auth/confirm", token=token, user=current_user) return redirect(url_for("foreground.index"))
def resend_email(): # 发送邮件 token = current_user.generate_confirmed_token() html = render_template('email/register.html', token=token, user_name=current_user.name) send_async_email(subject='物联网云平台验证邮件', recvs=[current_user.email], body=None, html=html) return redirect(url_for('main.user_info'))
def resendMail(): """ Resend confirmed email. """ if current_user.confirmed: return redirect(url_for("main.index")) if not current_user.is_authenticated: return redirect(url_for("auth.login")) token = current_user.generate_confirmed_token() send_mail( current_user.email, "Confirmed your account.", "/auth/mail/confirmed", user=current_user, token=token, ) flash("We have resent a confirmed email.") return render_template("auth/unconfirmed.html")