From 2d630a62f3846a901a38ef13e753554e66abc147 Mon Sep 17 00:00:00 2001
From: kosh
Date: Mon, 2 Sep 2024 05:14:09 +0530
Subject: [PATCH] Update mail
---
backend/src/utils/mail.py | 46 +++++----------------------------------
1 file changed, 6 insertions(+), 40 deletions(-)
diff --git a/backend/src/utils/mail.py b/backend/src/utils/mail.py
index 5d03473..26d808c 100644
--- a/backend/src/utils/mail.py
+++ b/backend/src/utils/mail.py
@@ -25,18 +25,14 @@ class MailHandler:
cls.__login_codes[mail] = secrets.token_hex(6)
cls.__init()
message = MIMEMultipart("alternative")
- message["Subject"] = "multipart test"
+ message["Subject"] = "OTP for logging in"
message["From"] = "ssth@sahyadri.edu.in"
message["To"] = mail
html = f"""
- Hi,
- How are you?
- Real Python
- has many great tutorials.
-
- {cls.__login_codes[mail]}
+ OTP:
+
{cls.__login_codes[mail]}
@@ -58,44 +54,14 @@ class MailHandler:
def send_success_mail(cls, mail: str) -> None:
cls.__init()
message = MIMEMultipart("alternative")
- message["Subject"] = "multipart test"
+ message["Subject"] = "Successfully joined team"
message["From"] = "ssth@sahyadri.edu.in"
message["To"] = mail
html = f"""
- Hi,
- How are you?
- Real Python
- has many great tutorials.
-
- You've joined!!!
-
-
-
- """
- part2 = MIMEText(html, "html")
- message.attach(part2)
- cls.__smtp.sendmail("ssth@sahyadri.edu.in", mail, message.as_string())
- cls.__close()
-
- @classmethod
- def send_warning_mail(cls, mail: str) -> None:
- cls.__init()
- message = MIMEMultipart("alternative")
- message["Subject"] = "multipart test"
- message["From"] = "ssth@sahyadri.edu.in"
- message["To"] = mail
-
- html = f"""
-
-
- Hi,
- How are you?
- Real Python
- has many great tutorials.
-
- You're joining...
+ Hello!!!
+
You've successfully joined the team!!!