Download auth/email.py from deedrop1140/machinelearningalgorithms: direct link, hf CLI and curl.
- Browser
- Download file 321 Bytes
-
https://huggingface.co/spaces/deedrop1140/machinelearningalgorithms/resolve/main/auth/email.py
- Command line
-
hf download hf://spaces/deedrop1140/machinelearningalgorithms/auth/email.py
-
curl -L -o email.py https://huggingface.co/spaces/deedrop1140/machinelearningalgorithms/resolve/main/auth/email.py
321 Bytes
| from flask_mail import Message | |
| from flask import current_app | |
| from .extensions import mail | |
| def send_otp(email, otp): | |
| msg = Message( | |
| subject="Your OTP Code", | |
| sender=current_app.config["MAIL_USERNAME"], | |
| recipients=[email] | |
| ) | |
| msg.body = f"Your OTP is {otp}" | |
| mail.send(msg) | |