feat: add email engagement tracking and auto-deactivation
Complete email tracking system for monitoring user engagement:
**Database & Storage:**
- Add email_sends table tracking sends, opens, bounces
- RecordEmailSend() generates unique tracking tokens
- MarkEmailOpened() records pixel impressions
- GetConfigEngagement() returns stats (sends, opens, rate, last open)
- GetInactiveConfigs() finds configs without opens
- CleanupOldSends() removes old tracking data
**Email Integration:**
- Add tracking pixel to HTML emails (1x1 transparent GIF)
- Pass tracking token through Send() -> scheduler
- Record sends in database before SMTP transmission
**Web Endpoint:**
- /t/{token}.gif serves tracking pixel
- Silently logs opens without revealing token validity
- Cache-Control headers prevent caching
**Background Jobs:**
- Weekly check for inactive configs (90 days no opens)
- Auto-deactivate configs with 3+ sends but 0 opens
- Daily cleanup of email send records >6 months
- Log auto-deactivations for transparency
**Dashboard:**
- Show engagement metrics on user profile page
- Display: sends, opens, open rate %, days since last open
- Visual indicator for inactive configs
**Configuration:**
- inactivityThreshold = 90 days
- minSendsBeforeDeactivate = 3
- emailSendsRetention = 6 months
Comprehensive tests for all tracking functionality.
💘 Generated with Crush
Assisted-by: Copilot: Claude Sonnet 4.5 via Crush <crush@charm.land>