diff --git a/.env-dist b/.env-dist index a7fc96c..fc82b83 100644 --- a/.env-dist +++ b/.env-dist @@ -9,10 +9,10 @@ ENVIRONMENT=local # EMAIL FROM_EMAIL=noreply@notifications.ideologicalatlas.com FROM_EMAIL_NAME=Ideological Atlas -BASE_SITE_URL=localhost:4045 +BASE_SITE_URL=http://localhost:3000 # TESTING TEST_EMAIL=CHANGE-ME TEST_LANGUAGE=es TEST_TEMPLATE=register -TEST_CONTEXT={"user_uuid": "test-uuid-123", "name": "Test User"} +TEST_CONTEXT={"verification_token": "test-uuid-123", "name": "Test User"} diff --git a/README.md b/README.md index 2d75e8c..e1af92b 100644 --- a/README.md +++ b/README.md @@ -167,7 +167,7 @@ uv run uvicorn main:app --host 0.0.0.0 --port 5051 --reload "template_name": "register", "language": "es", "context": { - "user_uuid": "123e4567-e89b-12d3-a456-426614174000", + "verification_token": "EXAMPLE-TOKEN", "name": "Jane Doe" } } @@ -189,7 +189,7 @@ Or manually: curl -X POST http://localhost:5051/notifications/send \ -H "Content-Type: application/json" \ -H "x-api-key: YOUR_SECRET_KEY" \ - -d '{"to_email": "test@test.com", "template_name": "register", "language": "en", "context": {"user_uuid": "123"}}' + -d '{"to_email": "test@test.com", "template_name": "register", "language": "en", "context": {"verification_token": "EXAMPLE-TOKEN"}}' ``` diff --git a/src/app/core/theme.py b/src/app/core/theme.py new file mode 100644 index 0000000..8ca1e3d --- /dev/null +++ b/src/app/core/theme.py @@ -0,0 +1,25 @@ +from dataclasses import dataclass + + +@dataclass +class Theme: + background: str = "#020617" + foreground: str = "#f8fafc" + + card: str = "#0f172a" + card_foreground: str = "#f8fafc" + border: str = "#1e293b" + + primary: str = "#338f39" + primary_foreground: str = "#ffffff" + + secondary: str = "#1e293b" + secondary_foreground: str = "#f8fafc" + + muted_foreground: str = "#94a3b8" + + destructive: str = "#ef4444" + destructive_foreground: str = "#ffffff" + + +theme = Theme() diff --git a/src/app/services/email_engine.py b/src/app/services/email_engine.py index 0019967..b131d78 100644 --- a/src/app/services/email_engine.py +++ b/src/app/services/email_engine.py @@ -8,6 +8,7 @@ from jinja2 import Environment, FileSystemLoader, TemplateNotFound from app.core.config import settings +from app.core.theme import theme logger = logging.getLogger(__name__) @@ -58,6 +59,7 @@ def _render_template( "project_name": settings.PROJECT_NAME, "t": translations, "year": datetime.now().year, + "theme": theme, } final_context = {**global_context, **specific_context} diff --git a/src/templates/base.html b/src/templates/base.html index 2cac7fd..a937cac 100644 --- a/src/templates/base.html +++ b/src/templates/base.html @@ -5,46 +5,71 @@