docs(adapter-contract): document optional sendBulk native batch method#135
Closed
tembo[bot] wants to merge 1 commit into
Closed
docs(adapter-contract): document optional sendBulk native batch method#135tembo[bot] wants to merge 1 commit into
tembo[bot] wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Author
|
Requesting review from @leoisadev1 who has experience with the following files modified in this PR:
|
Member
|
Closing as superseded by the #128 docs rewrite: reference/adapter-contract.mdx on main now documents sendBulk in the EmailProvider type and the options table (including the recipientVariables routing and per-recipient fallback), and reference/message.mdx covers the client-side fallback semantics in depth. The extra implementation detail here (assertMaxItems, jsonProvider wiring) is internal-helper territory the rewritten page intentionally keeps brief. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up documentation for the batch/
recipientVariablesfeature merged in #125. That PR thoroughly documented the user-facing surface (message + client references, Mailgun/SendGrid adapter pages, field-support matrix), but the new optionalEmailProvider.sendBulkmethod was left undocumented in the adapter-authoring reference. Adapter authors reading the canonical type contract would see anEmailProvidershape that no longer matches the source, with no guidance on implementing native batch personalization.This is a documentation-only change. No code was touched.
Docs added/updated
reference/adapter-contract.mdxsendBulkto theEmailProvidertype block and its<TypeTable>, so the contract matchespackages/email-sdk/src/types.ts.sendBulk)" section covering: when the client routes tosendBulkvssend, the exact shape of the message it receives (unexpanded, tokens still literal,recipientVariablesattached), the retry/this-binding/error behavior, theassertMaxItems1000-recipient fail-fast pattern, the built-in{ ...provider, sendBulk: provider.send }implementation pattern, and an explicit note that omittingsendBulkis safe because the client falls back to one rendered send per recipient.guides/authoring/create-adapter.mdxsendBulkas an optional optimization so the basic-adapter walkthrough stays focused.Codepaths covered
packages/email-sdk/src/types.ts—EmailProvider.sendBulk,RecipientVariables.packages/email-sdk/src/core.ts—attemptProviderrouting (nativesendBulkvssendBulkViaFallback), per-recipient idempotency suffix, aggregatedaccepted/rejected, all-recipients-failed fallthrough.packages/email-sdk/src/mailgun.ts/sendgrid.ts—sendBulk: sendwiring,assertMaxItems(..., 1000)cap, per-recipient personalizations.packages/email-sdk/src/utils.ts/payloads.ts—hasRecipientVariables,assertMaxItems,recipientVariableEntries, token substitution.Key knowledge gaps addressed
sendBulk(only when bothrecipientVariablesis present and the adapter implements it).sendBulkis unexpanded — the adapter, not the client, drives provider-side substitution.sendBulkis a pure performance optimization: the feature works on every adapter via the client-side fallback whether or not an adapter implements it.Validation
MDX-content-only edits; anchor slugs verified against the referenced headings. The docs app (
apps/fumadocs) dependencies are not installed in this sandbox and packages can't be installed here, sobun run types:check/ build were not run. No source, config, or frontmatter changed — only prose within existing pages.Triggered by the merge of #125 (
pull_request.merged).