Skip to content

Add Resend List Emails API with POST endpoint for recipient-based status lookup#188

Merged
gregv merged 2 commits intofeature/resend-list-emails-apifrom
copilot/sub-pr-187
Mar 6, 2026
Merged

Add Resend List Emails API with POST endpoint for recipient-based status lookup#188
gregv merged 2 commits intofeature/resend-list-emails-apifrom
copilot/sub-pr-187

Conversation

Copy link
Contributor

Copilot AI commented Mar 6, 2026

Adds a recipient-indexed Resend email status lookup API, replacing the resend_id-dependent approach so delivery status works for all historical emails. The resend-list endpoint is exposed as POST (not GET) to avoid 414/400 URL length failures with large volunteer lists.

What does the PR do?

Backend (services/volunteers_service.py)

  • list_all_resend_emails() — fetches Resend List Emails API (paginated, up to 10 pages), builds a recipient-keyed index, caches in Redis at resend:all_emails_index (300s TTL)
  • Cache is invalidated after send_volunteer_message() and send_email_to_address() succeed
  • Empty results are cached (avoids hammering Resend on zero-email accounts)
  • Page fetch errors skip caching entirely rather than serving partial stale data

API (api/volunteers/volunteers_views.py)

  • POST /api/admin/emails/resend-list — auth-protected endpoint; accepts { "emails": ["a@b.com", ...] } JSON body
  • emails field supports both array and comma-separated string
  • Switched from GET + query string to POST + JSON body to handle large volunteer lists without hitting URL length limits
POST /api/admin/emails/resend-list
Authorization: ******
Content-Type: application/json

{ "emails": ["volunteer@example.com", "another@example.com"] }

Type of change

  • Breaking Change
  • Bug Fix
  • New Feature

Linked Issue

Make sure you have

  • Pulled from the default branch
  • Documented your changes
  • Linked the Issue
  • Appointed a reviewer (if any)

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

… URL length limits

Co-authored-by: gregv <6913307+gregv@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Resend List Emails API for recipient-based status lookup Add Resend List Emails API with POST endpoint for recipient-based status lookup Mar 6, 2026
Copilot finished work on behalf of gregv March 6, 2026 05:07
@gregv gregv marked this pull request as ready for review March 6, 2026 05:25
@gregv gregv merged commit 2de1f45 into feature/resend-list-emails-api Mar 6, 2026
3 checks passed
@gregv gregv deleted the copilot/sub-pr-187 branch March 6, 2026 05:25
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.

2 participants