Stu Mason
Stu Mason

Activity

StuMason/cleanconnect
TidyLinker.com
TypeScript
Issue Opened

Issue #139 opened: Throttle Resend API calls in admin nudge bulk command

Problem

Sentry is repeatedly capturing Symfony\Component\Mailer\Exception\TransportException: Request to the Resend API failed. Reason: Too many requests. You can only make 5 requests per second. on /admin/nudge/bulk.

Sentry issues:

Cause

Bulk nudge sends emails synchronously without rate limiting. Resend caps at 5 requests/sec.

Fix

  • Push individual nudge sends onto the queue via ShouldQueue notifications, OR
  • Insert a usleep(250_000) between sends inside the bulk loop, OR
  • Wrap with Laravel's RateLimiter / use Bus::batch with a throttle middleware.

Queueing is the cleanest fix and aligns with how other transactional emails are sent.