mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: email sending and invites backend code
This commit is contained in:
parent
287fa8f41e
commit
79ddfb1ce1
9 changed files with 155 additions and 21 deletions
0
apps/api/src/services/email/__init__.py
Normal file
0
apps/api/src/services/email/__init__.py
Normal file
19
apps/api/src/services/email/utils.py
Normal file
19
apps/api/src/services/email/utils.py
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue