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.__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"""
|
||||
<html>
|
||||
<body>
|
||||
<p>Hi,<br>
|
||||
How are you?<br>
|
||||
<a href="http://www.realpython.com">Real Python</a>
|
||||
has many great tutorials.
|
||||
<br/>
|
||||
{cls.__login_codes[mail]}
|
||||
OTP:
|
||||
<h1>{cls.__login_codes[mail]}</h1>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
@ -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"""
|
||||
<html>
|
||||
<body>
|
||||
<p>Hi,<br>
|
||||
How are you?<br>
|
||||
<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...
|
||||
Hello!!!
|
||||
<h1>You've successfully joined the team!!!</h1>
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
x
Reference in New Issue
Block a user