feat: add List-Unsubscribe headers and throttle email sends#2507
feat: add List-Unsubscribe headers and throttle email sends#2507
Conversation
- Add List-Unsubscribe and List-Unsubscribe-Post headers to all outbound emails for Gmail/RFC 8058 one-click unsubscribe compliance - Reduce email queue concurrency from 30 to 10 - Add 1s delay between sends to avoid email spikes that trigger reputation systems Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryMedium Risk Overview Throttles email delivery. The Reviewed by Cursor Bugbot for commit 173863c. Bugbot is set up for automated code reviews on this repo. Configure here. |
wait.for suspends execution and frees the concurrency slot, defeating the throttling purpose. setTimeout holds the slot occupied for 1s, actually spacing out sends. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When RESEND_TO_TEST is set, toAddress becomes the test email. The unsubscribe URL should always reference the real recipient (params.to) so the token validates correctly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The one-click POST handler doesn't exist yet (unsubscribe page is GET only). Removed List-Unsubscribe-Post to avoid claiming RFC 8058 support we don't have. Added mailto fallback for broader client compatibility. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- New POST /v1/email/unsubscribe endpoint that accepts email+token via query params, verifies HMAC token, and unsubscribes the user - No auth required (token IS the auth, Gmail needs to POST directly) - Re-add List-Unsubscribe-Post header now that the handler exists - List-Unsubscribe URL points to API endpoint for one-click POST Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove unused getUnsubscribeUrl import from send-email.ts - Use crypto.timingSafeEqual for HMAC token verification in unsubscribe endpoint Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
CodeQL flagged that query params could be arrays. Explicitly coerce to string before using. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 173863c. Configure here.
# [3.21.0](v3.20.2...v3.21.0) (2026-04-10) ### Bug Fixes * **onboarding:** add initialize-organization trigger task and recover… ([#2512](#2512)) ([082501f](082501f)) * **onboarding:** disable Complete button while server action is running ([8e53a10](8e53a10)) * **onboarding:** don't delete org after session activation succeeds ([a9cb9c5](a9cb9c5)) * **onboarding:** fix org creation timeout and improve error handling ([726760d](726760d)) * **onboarding:** harden cancel action — guard completed orgs, switch before delete ([b1dec0e](b1dec0e)) * **onboarding:** hide cancel button while onboarding submission is in-flight ([887dfa9](887dfa9)) * **onboarding:** require fallback org before allowing cancel ([03452e3](03452e3)) * **onboarding:** rollback active org switch if delete fails ([9b884f0](9b884f0)) * **onboarding:** sanitize error messages shown to users ([14a35df](14a35df)) * use barrel import for email package (Trigger build fix) ([b165a18](b165a18)) ### Features * add List-Unsubscribe headers and throttle email sends ([#2507](#2507)) ([80db5d9](80db5d9)) * **onboarding:** add cancel button to abandon onboarding and return to previous org ([7d990c2](7d990c2))
|
🎉 This PR is included in version 3.21.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |

Summary
List-UnsubscribeandList-Unsubscribe-Postheaders to all outbound emails (Gmail/RFC 8058 compliance)Why
Part of domain reputation remediation (P0 SURBL incident). Gmail requires List-Unsubscribe for bulk senders. Email spikes from high concurrency can trigger reputation systems.
Impact
🤖 Generated with Claude Code