Skip to content

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

Open
Subhra-Nandi wants to merge 7 commits 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 7 commits into
Priyanshu-byte-coder:mainfrom
Subhra-Nandi:feat/weekly-email-digest

Conversation

@Subhra-Nandi

Copy link
Copy Markdown
Contributor

[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

vercel Bot commented May 30, 2026

Copy link
Copy Markdown

@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

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

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.

@Subhra-Nandi Subhra-Nandi force-pushed the feat/weekly-email-digest branch from 4a16dfa to f016e89 Compare June 1, 2026 03:46
@Priyanshu-byte-coder

Copy link
Copy Markdown
Owner

This PR has merge conflicts with the current main branch. Please rebase on the latest main to resolve them — your contribution is labeled for GSSoC scoring.

@Subhra-Nandi Subhra-Nandi force-pushed the feat/weekly-email-digest branch 2 times, most recently from 1e7e21f to f8d248c Compare June 2, 2026 12:32
@Priyanshu-byte-coder Priyanshu-byte-coder added the level:advanced GSSoC: Advanced difficulty (55 pts) label Jun 3, 2026
- 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 71c0a7f to 372e9a5 Compare June 3, 2026 11:29
@Subhra-Nandi Subhra-Nandi force-pushed the feat/weekly-email-digest branch from ddeb6db to 9d2b37d Compare June 4, 2026 05:07
@Priyanshu-byte-coder Priyanshu-byte-coder added the quality:clean GSSoC: Clean quality multiplier (×1.2) label Jun 4, 2026
@github-actions github-actions Bot added the type:testing GSSoC type bonus: tests (+10 pts) label Jun 4, 2026
@Priyanshu-byte-coder

Copy link
Copy Markdown
Owner

This PR has merge conflicts with main due to recent changes. Please rebase to continue:

git fetch origin
git rebase origin/main

Once you resolve the conflicts and CI passes, we can review for merge.

@Priyanshu-byte-coder

Copy link
Copy Markdown
Owner

Hi! This PR has merge conflicts with the main branch. Could you please rebase or merge main into your branch to resolve them? We'd love to get this merged! 🚀

git fetch upstream
git rebase upstream/main
# resolve any conflicts
git push --force-with-lease

If you're no longer working on this, let us know and we can close it. Thanks!

@Subhra-Nandi

Copy link
Copy Markdown
Contributor Author

Hi! Thanks for the heads-up. I won't be able to dedicate time to finish up the rebase or work on this feature further right now, so please feel free to close this pull request. Thanks for your time and guidance!

@Priyanshu-byte-coder

Copy link
Copy Markdown
Owner

This PR has merge conflicts with the main branch. Please rebase your branch on latest main and resolve the conflicts so it can be reviewed and merged.

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 level:advanced GSSoC: Advanced difficulty (55 pts) level3 GSSoC Level 3 - Advanced (45 points) quality:clean GSSoC: Clean quality multiplier (×1.2) type:feature GSSoC type bonus: new feature type:testing GSSoC type bonus: tests (+10 pts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Add weekly email digest with AI productivity summary

2 participants