mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: email invites frontend
This commit is contained in:
parent
79ddfb1ce1
commit
a6e81cb122
7 changed files with 168 additions and 11 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue