Skip to content

feat: add weekly email digest with AI productivity summary#1644

Open
Subhra-Nandi wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
Subhra-Nandi:feat/weekly-email-digest
Open

feat: add weekly email digest with AI productivity summary#1644
Subhra-Nandi wants to merge 1 commit into
Priyanshu-byte-coder:mainfrom
Subhra-Nandi:feat/weekly-email-digest

Conversation

@Subhra-Nandi
Copy link
Copy Markdown

[FEAT] Add weekly email digest with AI productivity summary

Closes #937

What this PR does

Implements the weekly email digest feature. Opted-in users receive a Monday 9am UTC email with an AI-generated productivity summary, current streak, top repo, PR stats, and a trend badge.

Changes

File Description
supabase/migrations/20260529000000_add_digest_settings.sql Adds digest_unsubscribe_token to users table
src/lib/digest.ts AI summary generator + email HTML builder
src/app/api/settings/digest/route.ts GET/POST opt-in preference API
src/app/api/cron/weekly-digest/route.ts Enhanced with AI summary + unsubscribe token
src/components/DigestOptIn.tsx Toggle switch component
src/app/settings/page.tsx New /settings page
src/app/unsubscribe/page.tsx Token-based one-click unsubscribe
src/components/DashboardHeader.tsx Gear icon linking to /settings
.env.example Documents new env vars

vercel.json already had the cron entry — no changes needed.

Acceptance Criteria

  • User can opt in/out in Settings
  • Cron triggers every Monday at 9am UTC
  • Email compatible with Gmail, Outlook, Apple Mail
  • Unsubscribe link in every email
  • Unsubscribe works without login

Screenshots

Screenshot 2026-05-30 173638

Required before deploying

  1. Run supabase/migrations/20260529000000_add_digest_settings.sql in Supabase SQL editor
  2. Add env vars in Vercel: RESEND_API_KEY, RESEND_FROM_EMAIL, GEMINI_API_KEY, CRON_SECRET

@vercel
Copy link
Copy Markdown

vercel Bot commented May 30, 2026

@Subhra-Nandi is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added gssoc26 GSSoC 2026 contribution type:feature GSSoC type bonus: new feature labels May 30, 2026
@github-actions
Copy link
Copy Markdown

GSSoC Label Checklist 🏷️

@Priyanshu-byte-coder — please apply the appropriate labels before merging:

Difficulty (pick one):

  • level:beginner — 20 pts
  • level:intermediate — 35 pts
  • level:advanced — 55 pts
  • level:critical — 80 pts

Quality (optional):

  • quality:clean — ×1.2 multiplier
  • quality:exceptional — ×1.5 multiplier

Validation (required to score):

  • gssoc:approved — counts for points
  • gssoc:invalid / gssoc:spam / gssoc:ai-slop — does not score

Type labels (type:*) are auto-detected from files and title. Review and adjust if needed.
Points formula: (difficulty × quality_multiplier) + type_bonus

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your first PR on DevTrack! 🎉

A maintainer will review it within 48 hours. While you wait:

  • Make sure CI is passing (type-check + lint)
  • Double-check the PR description is filled out and the issue is linked
  • Feel free to ask questions in Discussions if you need help

If you find DevTrack useful, a ⭐ star on the repo is always appreciated — it helps the project grow and attract more contributors!

@Subhra-Nandi Subhra-Nandi force-pushed the feat/weekly-email-digest branch from 32d0c0e to 1d7fce6 Compare May 30, 2026 12:37
@Priyanshu-byte-coder
Copy link
Copy Markdown
Owner

This PR has merge conflicts with main. Please rebase your branch against the latest main and force-push to resolve. Run: git fetch upstream && git rebase upstream/main

@Priyanshu-byte-coder Priyanshu-byte-coder added gssoc:approved GSSoC: PR approved for scoring level3 GSSoC Level 3 - Advanced (45 points) labels May 31, 2026
@Subhra-Nandi Subhra-Nandi force-pushed the feat/weekly-email-digest branch 2 times, most recently from 99d9efd to 4a16dfa Compare May 31, 2026 06:30
@Priyanshu-byte-coder
Copy link
Copy Markdown
Owner

This PR has developed merge conflicts after recent merges to main. Please rebase onto the latest main branch, resolve all conflicts, and force-push. Once the PR is conflict-free it will be reviewed for merging.

- Opt-in toggle in /settings (DigestOptIn component)
- GET/POST /api/settings/digest for preference management
- Cron endpoint /api/cron/weekly-digest fires every Monday 9am UTC
- AI summary generation in src/lib/digest.ts
- Inline-styled HTML email via Resend
- One-click unsubscribe at /unsubscribe?token=<uuid>
- DB migration adds digest_unsubscribe_token to users table
- Settings gear icon added to DashboardHeader

Closes Priyanshu-byte-coder#937
@Subhra-Nandi Subhra-Nandi force-pushed the feat/weekly-email-digest branch from 4a16dfa to f016e89 Compare June 1, 2026 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved GSSoC: PR approved for scoring gssoc26 GSSoC 2026 contribution level3 GSSoC Level 3 - Advanced (45 points) type:feature GSSoC type bonus: new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Add weekly email digest with AI productivity summary

2 participants