From d625fa46eab175cd1e145b3f411df5f639ea0de5 Mon Sep 17 00:00:00 2001 From: jelveh Date: Mon, 20 Jul 2026 11:28:13 -0700 Subject: [PATCH] feat(email): envelope override in sendRaw + suppressed in EmailSendResult type Adds an optional `envelope` field to SendMailOptions so callers can set transport recipients independently of the visible To/Cc headers (used by the email-send driver for per-recipient deliveries), and adds the `suppressed: string[]` field to the public EmailSendResult typing to match the driver's documented result. Co-Authored-By: Claude Fable 5 --- src/backend/clients/email/EmailClient.ts | 5 +++++ src/puter-js/types/modules/email.d.ts | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/backend/clients/email/EmailClient.ts b/src/backend/clients/email/EmailClient.ts index f345f630d..7e274c470 100644 --- a/src/backend/clients/email/EmailClient.ts +++ b/src/backend/clients/email/EmailClient.ts @@ -45,6 +45,11 @@ export interface SendMailOptions { to: string; cc?: string; bcc?: string; + /** Optional transport recipients when they differ from visible headers. */ + envelope?: { + from?: string; + to: string; + }; subject: string; html?: string; text?: string; diff --git a/src/puter-js/types/modules/email.d.ts b/src/puter-js/types/modules/email.d.ts index 50435a763..e865d970f 100644 --- a/src/puter-js/types/modules/email.d.ts +++ b/src/puter-js/types/modules/email.d.ts @@ -36,10 +36,12 @@ export interface EmailSendOptions { } export interface EmailSendResult { - /** Transport message id, when the mail server reports one. */ + /** First transport message id reported for this send, when available. */ messageId: string | null; /** Total charge for this send, in microcents. */ cost: number; + /** Recipients omitted because they opted out of this sender's mail. */ + suppressed: string[]; } /**