• Dockerfile: bump Gunicorn workers to 4 for concurrent request handling
• server.py:
- Load SMTP credentials once at startup
- Wrap send_confirmation_email in a daemon Thread for “fire-and-forget” delivery
- Replace print() with structured app.logger.error() on failure
- Add before_request/after_request hooks to log per-request durations
- Use context manager for SMTP_SSL connections (auto-close)
- Simplify route JSON responses and HTTP methods declarations
- Retain existing DB logic but recommend low DB connect_timeouts
- Ensure Flask binds on 0.0.0.0 in development
These changes eliminate request blocking on email I/O, expose request latencies in logs, and improve overall concurrency.
* Created a newsletters table and added insertion logic during newsletter send.
* Added a /newsletters route to display a list of sent newsletters.
* Implemented a /newsletter/<int:newsletter_id> route for detailed view.
* Developed new templates with navigation, including unsubscribe links.
* Enhanced front-end styling and layout for newsletter pages.