feat: email invites frontend

This commit is contained in:
swve 2024-03-18 23:23:03 +00:00
parent 79ddfb1ce1
commit a6e81cb122
7 changed files with 168 additions and 11 deletions

View file

@ -1,19 +1,19 @@
from pydantic import EmailStr
import resend
from config.config import get_learnhouse_config
def send_email(to: str, subject: str, body: str):
def send_email(to: EmailStr, subject: str, body: str):
lh_config = get_learnhouse_config()
params = {
"from": f"LearnHouse <"
+ lh_config.mailing_config.system_email_address
+ ">",
"from": "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