Add Resend List Emails API for recipient-based status lookup#187
Open
Add Resend List Emails API for recipient-based status lookup#187
Conversation
Adds a new endpoint GET /api/admin/emails/resend-list that fetches all sent emails from Resend's List Emails API, indexes them by recipient email address, and caches the result in Redis (300s TTL). This removes the dependency on stored resend_id values for showing delivery status. Also invalidates the cache after sending new emails. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The installed resend 2.3.0 didn't have Emails.list(). Upgraded to 2.22.0 which supports list() with pagination (limit, after cursor, has_more). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
list_all_resend_emails()function that fetches all sent emails from Resend's List Emails API, builds a recipient-indexed lookup, and caches in Redis (300s TTL)GET /api/admin/emails/resend-list?emails=a@b.com,c@d.comendpoint (auth-protected) for the frontend to query email delivery status by recipient addresssend_volunteer_message()andsend_email_to_address()This removes the dependency on stored
resend_idvalues for showing email delivery status — older emails or emails sent before tracking was added will now show status.Test plan
GET /api/admin/emails/resend-listwith auth headers — verify it returns emails indexed by recipient?emails=test@example.comfilter — verify only matching recipients returnedresend:all_emails_indexkey — should appear after first call, expire after 5 minPOST /api/admin/emails/resend-statusendpoint still works unchanged🤖 Generated with Claude Code