feat: Implement email functionality with FastAPI-Mail and Mailhog
- Updated docker-compose.yml to include Mailhog service for email testing. - Added environment variables for email configuration in docker-compose. - Updated requirements.txt to include fastapi-mail for email support. - Created templates for password reset, email verification, and welcome emails. - Developed mail utility module to handle sending emails using FastAPI-Mail. - Added documentation for email testing with Mailhog.
This commit is contained in:
+26
-1
@@ -34,7 +34,19 @@ services:
|
||||
DB_USER: "pubquiz_user"
|
||||
DB_PASS: "pubquiz_pass"
|
||||
PYTHONUNBUFFERED: "1"
|
||||
LEAGUELEDGER_BASE_URL: "https://rover.leagueledger.net" # Base URL for QR codes
|
||||
# Use environment variable from .env instead of hard-coding
|
||||
LEAGUELEDGER_BASE_URL: ${LEAGUELEDGER_BASE_URL:-http://localhost:8000}
|
||||
# Email configuration for Mailhog
|
||||
MAIL_USERNAME: ""
|
||||
MAIL_PASSWORD: ""
|
||||
MAIL_FROM: "noreply@leagueledger.net"
|
||||
MAIL_FROM_NAME: "LeagueLedger"
|
||||
MAIL_PORT: 1025
|
||||
MAIL_SERVER: "mailpit"
|
||||
MAIL_STARTTLS: "False"
|
||||
MAIL_SSL_TLS: "False"
|
||||
MAIL_USE_CREDENTIALS: "False"
|
||||
MAIL_VALIDATE_CERTS: "False"
|
||||
command: uvicorn app.main:app --host 0.0.0.0 --reload
|
||||
ports:
|
||||
- "8000:8000"
|
||||
@@ -55,4 +67,17 @@ services:
|
||||
ports:
|
||||
- "8001:80"
|
||||
|
||||
mailpit:
|
||||
image: axllent/mailpit # Updated image name
|
||||
container_name: pubquiz_mailpit
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "8025:8025" # Web UI
|
||||
- "1025:1025" # SMTP Server
|
||||
environment:
|
||||
MH_STORAGE: "memory" # Store emails in memory (they will be lost on container restart)
|
||||
MH_UI_WEB_PATH: "/" # Base path for the web UI
|
||||
networks:
|
||||
- default
|
||||
|
||||
# No persistent volumes defined - database will reset when container stops
|
||||
|
||||
Reference in New Issue
Block a user