Spaces:
Runtime error
Runtime error
Update app/email_utils.py
Browse files- app/email_utils.py +16 -10
app/email_utils.py
CHANGED
|
@@ -12,22 +12,28 @@ def send_verification_email(to_email, username, token):
|
|
| 12 |
|
| 13 |
subject = "Verify your account"
|
| 14 |
verification_link = f"https://webcodelab-ai-resume-ranker-api.hf.space/verify/{token}"
|
| 15 |
-
|
| 16 |
-
body = f"""
|
| 17 |
-
Hi {username},
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
"""
|
| 25 |
|
| 26 |
data = {
|
| 27 |
-
"from": f"
|
| 28 |
"to": [to_email],
|
| 29 |
"subject": subject,
|
| 30 |
-
"
|
|
|
|
| 31 |
}
|
| 32 |
|
| 33 |
try:
|
|
|
|
| 12 |
|
| 13 |
subject = "Verify your account"
|
| 14 |
verification_link = f"https://webcodelab-ai-resume-ranker-api.hf.space/verify/{token}"
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
+
html_body = f"""
|
| 17 |
+
<html>
|
| 18 |
+
<body style="font-family: Arial, sans-serif; line-height: 1.6;">
|
| 19 |
+
<p>Hi {username},</p>
|
| 20 |
+
<p>Thanks for registering! Please verify your email by clicking the button below:</p>
|
| 21 |
+
<p>
|
| 22 |
+
<a href="{verification_link}" style="background-color: #007BFF; color: white; padding: 12px 20px; text-decoration: none; border-radius: 5px; display: inline-block;">
|
| 23 |
+
Verify Email
|
| 24 |
+
</a>
|
| 25 |
+
</p>
|
| 26 |
+
<p>If you didn't sign up, you can safely ignore this email.</p>
|
| 27 |
+
</body>
|
| 28 |
+
</html>
|
| 29 |
"""
|
| 30 |
|
| 31 |
data = {
|
| 32 |
+
"from": f"RankApply <{from_email}>",
|
| 33 |
"to": [to_email],
|
| 34 |
"subject": subject,
|
| 35 |
+
"html": html_body,
|
| 36 |
+
"text": f"Hi {username},\n\nPlease verify your account:\n{verification_link}"
|
| 37 |
}
|
| 38 |
|
| 39 |
try:
|