Skip to content

Feature Request: Implement Scheduled Email Reports #265

Description

@mustafaneguib

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

  1. Email Service (SendGrid or AWS SES)
  2. Email Schedule Table - Similar to refresh schedules
  3. Dashboard Snapshot Service - Server-side rendering
  4. Email Queue System - Background job processing
  5. 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

  • Users receive emails on schedule
  • Dashboard snapshots render correctly
  • Multiple recipients supported
  • Failed deliveries logged and retried
  • Unsubscribe mechanism
  • Beautiful HTML email templates
  • Attachments under 10MB

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)

Metadata

Metadata

Assignees

No one assigned

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions