Skip to content

fix: harden Cloudflare email sending - #558

Open
cuijianzhuang wants to merge 1 commit into
maillab:mainfrom
cuijianzhuang:fix/cloudflare-email-sending
Open

cuijianzhuang wants to merge 1 commit into
maillab:mainfrom
cuijianzhuang:fix/cloudflare-email-sending

Conversation

@cuijianzhuang

Copy link
Copy Markdown
  • send attachments as base64: wrangler dev's local simulator cannot serialize ArrayBuffer attachment content, so any send with an attachment fails locally
  • split recipients into batches of 50, the documented per-message limit for to + cc + bcc, instead of letting a larger group send fail outright
  • check the 5 MiB message size limit up front and report a readable error
  • catch errors from env.email.send(), which throws, and return them in the same { data, error } shape the caller already expects from Resend

Claude-Session: https://claude.ai/code/session_01Mw6xv9y5RaaBFXNGvrhTLo

- send attachments as base64: wrangler dev's local simulator cannot serialize
  ArrayBuffer attachment content, so any send with an attachment fails locally
- split recipients into batches of 50, the documented per-message limit for
  to + cc + bcc, instead of letting a larger group send fail outright
- check the 5 MiB message size limit up front and report a readable error
- catch errors from env.email.send(), which throws, and return them in the
  same { data, error } shape the caller already expects from Resend

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mw6xv9y5RaaBFXNGvrhTLo
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