Update mail
This commit is contained in:
parent
f0e53c4953
commit
2d630a62f3
@ -25,18 +25,14 @@ class MailHandler:
|
|||||||
cls.__login_codes[mail] = secrets.token_hex(6)
|
cls.__login_codes[mail] = secrets.token_hex(6)
|
||||||
cls.__init()
|
cls.__init()
|
||||||
message = MIMEMultipart("alternative")
|
message = MIMEMultipart("alternative")
|
||||||
message["Subject"] = "multipart test"
|
message["Subject"] = "OTP for logging in"
|
||||||
message["From"] = "ssth@sahyadri.edu.in"
|
message["From"] = "ssth@sahyadri.edu.in"
|
||||||
message["To"] = mail
|
message["To"] = mail
|
||||||
html = f"""
|
html = f"""
|
||||||
<html>
|
<html>
|
||||||
<body>
|
<body>
|
||||||
<p>Hi,<br>
|
OTP:
|
||||||
How are you?<br>
|
<h1>{cls.__login_codes[mail]}</h1>
|
||||||
<a href="http://www.realpython.com">Real Python</a>
|
|
||||||
has many great tutorials.
|
|
||||||
<br/>
|
|
||||||
{cls.__login_codes[mail]}
|
|
||||||
</p>
|
</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@ -58,44 +54,14 @@ class MailHandler:
|
|||||||
def send_success_mail(cls, mail: str) -> None:
|
def send_success_mail(cls, mail: str) -> None:
|
||||||
cls.__init()
|
cls.__init()
|
||||||
message = MIMEMultipart("alternative")
|
message = MIMEMultipart("alternative")
|
||||||
message["Subject"] = "multipart test"
|
message["Subject"] = "Successfully joined team"
|
||||||
message["From"] = "ssth@sahyadri.edu.in"
|
message["From"] = "ssth@sahyadri.edu.in"
|
||||||
message["To"] = mail
|
message["To"] = mail
|
||||||
html = f"""
|
html = f"""
|
||||||
<html>
|
<html>
|
||||||
<body>
|
<body>
|
||||||
<p>Hi,<br>
|
Hello!!!
|
||||||
How are you?<br>
|
<h1>You've successfully joined the team!!!</h1>
|
||||||
<a href="http://www.realpython.com">Real Python</a>
|
|
||||||
has many great tutorials.
|
|
||||||
<br/>
|
|
||||||
You've joined!!!
|
|
||||||
</p>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
"""
|
|
||||||
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"""
|
|
||||||
<html>
|
|
||||||
<body>
|
|
||||||
<p>Hi,<br>
|
|
||||||
How are you?<br>
|
|
||||||
<a href="http://www.realpython.com">Real Python</a>
|
|
||||||
has many great tutorials.
|
|
||||||
<br/>
|
|
||||||
You're joining...
|
|
||||||
</p>
|
</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user