Zakladni mailing
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user