2026.06.04 frontend építés közben

This commit is contained in:
Roo
2026-06-04 07:26:22 +00:00
parent 7adf6cc3e3
commit 59a30ac428
3302 changed files with 24091 additions and 1771 deletions

View File

@@ -0,0 +1 @@
{"version":1,"resource":"vscode-remote://192.168.100.43:8443/home/coder/project/backend/app/core/email.py","entries":[{"id":"hYxe.py","timestamp":1769041483049}]}

View File

@@ -0,0 +1,33 @@
import os
from sendgrid import SendGridAPIClient
from sendgrid.helpers.mail import Mail
from fastapi import BackgroundTasks
SENDGRID_API_KEY = os.getenv("SENDGRID_API_KEY")
FROM_EMAIL = os.getenv("FROM_EMAIL")
async def send_email_async(subject: str, to_email: str, content: str):
message = Mail(
from_email=FROM_EMAIL,
to_emails=to_email,
subject=subject,
plain_text_content=content
)
try:
sg = SendGridAPIClient(SENDGRID_API_KEY)
sg.send(message)
except Exception as e:
print(f"--- EMAIL ERROR: {e}")
def send_verification_email(background_tasks: BackgroundTasks, email: str, token: str):
subject = "Service Finder - Fiók aktiválása"
# Itt a valós domain nevedet kell használnod
verify_url = f"http://192.168.100.43:8000/api/v1/auth/verify/{token}"
content = f"Kérjük, kattints az alábbi linkre a regisztrációd véglegesítéséhez: {verify_url}"
background_tasks.add_task(send_email_async, subject, email, content)
def send_expiry_notification(background_tasks: BackgroundTasks, email: str, doc_name: str):
subject = f"FIGYELEM: {doc_name} hamarosan lejár!"
content = f"Tisztelt Felhasználó! Értesítjük, hogy a(z) {doc_name} dokumentuma 30 napon belül lejár."
background_tasks.add_task(send_email_async, subject, email, content)