Implement Scheduled Email Reports
Priority
MEDIUM - Team tier feature
Labels
enhancement, backend, email, dashboard, cron
Description
Send automated email reports with dashboard snapshots on schedule (daily, weekly, monthly). Users receive PDF/PNG exports of dashboards directly in email.
Current State
- Email verification exists (
DRAVerificationCode)
- No email sending service
- Dashboard export to image exists (frontend)
- No email scheduling mechanism
Evidence:
// frontend/pages/projects/[projectid]/dashboards/[dashboardid]/index.vue
function exportDashboardAsImage() {
// html2canvas implementation exists
}
Implementation Overview
Required Components
- Email Service (SendGrid or AWS SES)
- Email Schedule Table - Similar to refresh schedules
- Dashboard Snapshot Service - Server-side rendering
- Email Queue System - Background job processing
- Email Templates - HTML templates for reports
Key Features
- Schedule Types: Daily, weekly, monthly
- Recipients: Multiple email addresses
- Format: PDF or PNG attachment
- Content: Dashboard snapshot + summary statistics
- Delivery Status: Track sent/failed emails
Database Schema
// Models needed:
- DRAEmailReportSchedule
- DRAEmailReportLog
- DRAEmailRecipient
Integration Points
- Use existing
ScheduledBackupService pattern
- Leverage dashboard export functionality
- Integrate with subscription tier limits
- Require DASHBOARD_SHARE permission (RBAC)
Dependencies
- Puppeteer or Playwright (server-side rendering)
- Email service API (SendGrid, AWS SES, Nodemailer)
- File storage for temporary PDFs
- Dashboard refresh scheduler (optional)
Estimated Effort
- Email service setup: 4 hours
- Dashboard server-side rendering: 8 hours
- Email scheduling: 6 hours
- Email templates: 4 hours
- API routes: 4 hours
- Frontend UI: 6 hours
- Testing: 6 hours
- Total: ~38 hours (5 developer days)
Success Criteria
Future Enhancements
- Custom email branding
- Report customization (which components to include)
- Inline vs attachment options
- CSV data export in email
- Email analytics (open rate, click rate)
Implement Scheduled Email Reports
Priority
MEDIUM - Team tier feature
Labels
enhancement,backend,email,dashboard,cronDescription
Send automated email reports with dashboard snapshots on schedule (daily, weekly, monthly). Users receive PDF/PNG exports of dashboards directly in email.
Current State
DRAVerificationCode)Evidence:
Implementation Overview
Required Components
Key Features
Database Schema
Integration Points
ScheduledBackupServicepatternDependencies
Estimated Effort
Success Criteria
Future Enhancements