Skip to content

feat(email-sdk): add Cloudflare Worker binding support to cloudflare adapter - #180

Open
imorius wants to merge 3 commits into
opencoredev:mainfrom
imorius:support-worker-binding
Open

feat(email-sdk): add Cloudflare Worker binding support to cloudflare adapter#180
imorius wants to merge 3 commits into
opencoredev:mainfrom
imorius:support-worker-binding

Conversation

@imorius

@imorius imorius commented Aug 8, 2026

Copy link
Copy Markdown

Why

The Cloudflare adapter only supported Cloudflare's Email Sending REST API (apiToken and accountId). Applications running directly inside a Cloudflare Worker could not utilize the native SendEmail Worker binding (env.SEB), forcing unnecessary API token configuration.

What changed

  • add Cloudflare Worker Email Sending Binding (SendEmail) support to the cloudflare() adapter
  • allow passing binding option (e.g. binding: env.SEB) as a mutually exclusive alternative to REST API credentials (apiToken/accountId)
  • map message recipients (to, cc, bcc, replyTo), headers, text/html content, and attachments to the Cloudflare Worker binding payload
  • add unit tests for binding send behavior, result message ID parsing, and error handling in cloudflare.test.ts
  • update Cloudflare adapter documentation in apps/fumadocs with Worker binding configuration examples and <TypeTable> options
  • add a minor changeset for @opencoredev/email-sdk

imorius added 2 commits August 8, 2026 17:07
…adapter

- Support Cloudflare Worker SendEmail binding in cloudflare() adapter

- Add unit tests and changeset for release tracking
- Document Cloudflare Worker send_email binding support in cloudflare() adapter

- Add configuration code example for Worker binding mode

- Update TypeTable options and return value notes
@vercel

vercel Bot commented Aug 8, 2026

Copy link
Copy Markdown

@imorius is attempting to deploy a commit to the OpenCore Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps

greptile-apps Bot commented Aug 8, 2026

Copy link
Copy Markdown

Greptile Summary

The Cloudflare adapter now supports sending through a native Worker Email Sending binding as an alternative to REST credentials. Focused execution confirmed the binding path sends attachments in a supported format, preserves recipients, and normalizes returned message IDs. No blocking failure remains.

Confidence Score: 5/5

No blocking failure remains.

The Worker binding path and focused Cloudflare adapter tests completed successfully, with no accepted blocking findings.

T-Rex T-Rex Logs

What T-Rex did

  • Ran the baseline Cloudflare binding contract repro script and observed bindingCalls were 0 with an HTTP fallback.
  • Ran the current Cloudflare binding contract repro script and observed bindingCalls 1, attachmentContent "AP9B", returnedId "cf-message-42", and accepted recipients to@example.com and cc@example.com.
  • Ran the Cloudflare-related tests; all tests passed (8 pass, 0 fail).
  • Fetched PR comments via the GitHub API and found no comments (empty array).

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (2): Last reviewed commit: "chore(docs): update lastmod timestamps" | Re-trigger Greptile

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