mirror of
https://github.com/HeyPuter/puter.git
synced 2026-08-27 00:16:44 +00:00
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:
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user