feat(email): document per-recipient best-effort delivery via failed

The email-send driver now attempts every recipient's private delivery
even when one fails, returning failed addresses in the result's
`failed` array instead of failing the whole call — so callers retry
only the failed subset and never re-mail delivered recipients. Adds
the field to the public EmailSendResult typing and module docs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
jelveh
2026-07-20 11:46:26 -07:00
co-authored by Claude Fable 5
parent d625fa46ea
commit 2d37e5598d
2 changed files with 11 additions and 0 deletions
+5
View File
@@ -27,6 +27,11 @@ import * as utils from '../lib/utils.js';
* Recipients who unsubscribe are dropped from future sends — they come
* back in the result's `suppressed` array — and a send whose `to` list
* is entirely unsubscribed is rejected.
*
* Each recipient gets a private delivery. A recipient whose delivery
* fails comes back in the result's `failed` array (everyone else got
* their copy — retry with just those addresses); the call only rejects
* when no recipient could be delivered.
*/
class Email {
/**
+6
View File
@@ -42,6 +42,12 @@ export interface EmailSendResult {
cost: number;
/** Recipients omitted because they opted out of this sender's mail. */
suppressed: string[];
/**
* Recipients whose delivery attempt failed. Everyone else got their
* copy — retry with just these addresses. A send where every delivery
* fails rejects instead.
*/
failed: string[];
}
/**