feat: email sending and invites backend code

This commit is contained in:
swve 2024-03-18 22:26:09 +00:00
parent 287fa8f41e
commit 79ddfb1ce1
9 changed files with 155 additions and 21 deletions

View file

View file

@ -0,0 +1,19 @@
import resend
from config.config import get_learnhouse_config
def send_email(to: str, subject: str, body: str):
lh_config = get_learnhouse_config()
params = {
"from": f"LearnHouse <"
+ lh_config.mailing_config.system_email_address
+ ">",
"to": [to],
"subject": subject,
"html": body,
}
resend.api_key = lh_config.mailing_config.resend_api_key
email = resend.Emails.send(params)
return email