Skip to content

Comments

Add Resend List Emails API for recipient-based status lookup#187

Open
gregv wants to merge 2 commits intodevelopfrom
feature/resend-list-emails-api
Open

Add Resend List Emails API for recipient-based status lookup#187
gregv wants to merge 2 commits intodevelopfrom
feature/resend-list-emails-api

Conversation

@gregv
Copy link
Contributor

@gregv gregv commented Feb 22, 2026

Summary

  • Adds 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)
  • Adds GET /api/admin/emails/resend-list?emails=a@b.com,c@d.com endpoint (auth-protected) for the frontend to query email delivery status by recipient address
  • Invalidates the Resend email list cache after sending emails in send_volunteer_message() and send_email_to_address()

This removes the dependency on stored resend_id values for showing email delivery status — older emails or emails sent before tracking was added will now show status.

Test plan

  • Call GET /api/admin/emails/resend-list with auth headers — verify it returns emails indexed by recipient
  • Call with ?emails=test@example.com filter — verify only matching recipients returned
  • Check Redis for resend:all_emails_index key — should appear after first call, expire after 5 min
  • Send a new email via the admin panel, verify cache invalidation (key deleted)
  • Verify the existing POST /api/admin/emails/resend-status endpoint still works unchanged

🤖 Generated with Claude Code

gregv and others added 2 commits February 22, 2026 10:46
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant