Skip to content

Commit fa9590c

Browse files
committed
Added mail utility
1 parent 18998bc commit fa9590c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

backend/PyMatcha/utils/mails.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from PyMatcha import mail
2+
3+
from flask_mail import Message
4+
5+
6+
def send_mail_text(dest: str, subject: str, body: str, sender: str = "pymatcha@gmail.com"):
7+
msg = Message(subject=subject, body=body, sender=sender, recipients=[dest])
8+
mail.send(msg)
9+
10+
11+
def send_mail_html(dest: str, subject: str, body: str, sender: str = "pymatcha@gmail.com"):
12+
msg = Message(subject=subject, body=body, sender=sender, recipients=dest)
13+
mail.send(msg)

0 commit comments

Comments
 (0)