Zakladni mailing

This commit is contained in:
Michal Kváček
2024-02-01 07:22:14 +01:00
parent cc95197682
commit 77b9552a9d
11 changed files with 124 additions and 46 deletions
+20
View File
@@ -0,0 +1,20 @@
from fastapi import BackgroundTasks
from pydantic import BaseModel
from starlette.responses import Response
from background_jobs.send_email import send_email
from emails.emails import WelcomeEmail, ContactFormEmail
class ContactInput(BaseModel):
email_from: str
content: str
class ContactEndpoint():
async def on_post(self, input: ContactInput, resp: Response, backgorund_tasks: BackgroundTasks):
backgorund_tasks.add_task(send_email, ContactFormEmail(
email_from=input.email_from,
content=input.content
))
# todo vratit nejakou smysluplnou