feat(email): accept custom message headers in sendRaw

Lets callers set transport-level headers such as List-Unsubscribe /
List-Unsubscribe-Post. Also documents the puter-email driver's automatic
unsubscribe / report-abuse footer and the new `suppressed` result field
in the puter.js email module.
This commit is contained in:
jelveh
2026-07-20 10:38:27 -07:00
parent dd314da16d
commit f6e6a3186c
2 changed files with 7 additions and 0 deletions
+2
View File
@@ -50,6 +50,8 @@ export interface SendMailOptions {
text?: string;
replyTo?: string;
attachments?: EmailAttachment[];
/** Extra message headers (e.g. List-Unsubscribe), passed to the transport. */
headers?: Record<string, string>;
}
export type EmailValidator = (email: string) => Promise<boolean> | boolean;
+5
View File
@@ -22,6 +22,11 @@ import * as utils from '../lib/utils.js';
* });
*
* Positional form: `await puter.email.send(to, subject, body)`.
*
* Every mail automatically gets an unsubscribe / report-abuse footer.
* 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.
*/
class Email {
/**