Feat: weekly email digest of coding activity summary#1157
Conversation
|
@diksha78dev 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. |
GSSoC Label Checklist 🏷️@Priyanshu-byte-coder — please apply the appropriate labels before merging: Difficulty (pick one):
Quality (optional):
Validation (required to score):
|
|
Good feature overall. One concern: adding Please add a try/catch around the email field or add the column to the migration before this can be safely merged. The rest of the feature (tiered settings with the 42703 fallback) is correctly handled. |
|
I'll make the required changes and resolve the conflicts.. |
# Conflicts: # e2e/landing.spec.js # src/lib/auth.ts
1e81b85 to
3a29d3f
Compare
# Conflicts: # vercel.json
|
@Priyanshu-byte-coder i have resolved the merge conflicts . |
Summary
Adds a new opt-in feature for users to receive a weekly email digest summarizing their coding habits. The feature introduces a new UI toggle in the settings and a secure Vercel Cron endpoint to handle dispatching emails via the Resend API.
Closes #1028
Type of Change
Changes Made
Database : Added a migration to include weekly_digest_opt_in (boolean) and email (text) to the users Supabase table.
Auth: Updated NextAuth signIn callback to capture and save the user's email to the database on login.
Settings UI/API : Added a new "Weekly Email Digest" toggle in the Settings page and updated the GET / PATCH routes to support the new field.
Cron API: Created a secured /api/cron/weekly-digest route that queries opted-in users and sends HTML digests using a native fetch request to the Resend API (keeping dependencies small).
Vercel Config: Configured vercel.json with a cron schedule (0 9 * * 1 - every Monday at 9 AM UTC).
Testing Fix: Fixed a pre-existing duplicate test title in landing.spec.js that caused E2E test failures.
How to Test
Steps for the reviewer to verify this works:
Screenshots (if UI change)
Checklist
npm run lintpasses locallynpm run type-check)