feat: implement email notification worker with Mailgun integration
- Add MongoDB connection module for database access - Implement Mailgun email service for sending notifications - Add shareChecksum utility for generating secure share links - Implement three email sender functions: - Email verification requests (highest priority) - Rent due notifications (CET timezone) - Utility bills due notifications - Create main email worker with budget-based email sending - Add environment variables for configuration - Install dependencies: mongodb, mailgun.js, form-data - Update package.json description to reflect email worker purpose - Add .env.example with all required configuration The worker processes emails in priority order and respects a configurable budget to prevent overwhelming the mail server. All database operations are atomic and updates are performed immediately after each email send. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
26
email-worker/.env.example
Normal file
26
email-worker/.env.example
Normal file
@@ -0,0 +1,26 @@
|
||||
# Worker Configuration
|
||||
PULL_INTERVAL=60000
|
||||
EMAIL_BUDGET=10
|
||||
|
||||
# MongoDB Configuration
|
||||
MONGODB_URI=mongodb://localhost:27017/utility-bills
|
||||
|
||||
# Mailgun Configuration
|
||||
MAILGUN_API_KEY=your-mailgun-api-key-here
|
||||
MAILGUN_DOMAIN=rezije.app
|
||||
|
||||
# Security
|
||||
SHARE_LINK_SECRET=your-secret-key-here
|
||||
|
||||
# Server Configuration
|
||||
PORT=3000
|
||||
|
||||
# Logging
|
||||
DEBUG=worker:*,email:*,db:*
|
||||
|
||||
# Prometheus Metrics (optional)
|
||||
PROMETHEUS_APP_LABEL=email-worker
|
||||
PROMETHEUS_HISTOGRAM_BUCKETS=0.1, 0.5, 1, 5, 10
|
||||
|
||||
# Environment
|
||||
ENV=dev
|
||||
Reference in New Issue
Block a user