Initial commit

This commit is contained in:
2026-08-02 20:55:23 +02:00
parent 411f484b40
commit d558d18d9a
295 changed files with 9 additions and 5880 deletions
-34
View File
@@ -1,34 +0,0 @@
import 'server-only';
import type { BasePayload } from 'payload';
export type SendEmailArgs = {
/** Override the configured from-address for this message. */
from?: string;
/** HTML body. */
html: string;
/** Payload instance — used to read SMTP config from SiteIntegrations. */
payload: BasePayload;
replyTo?: string;
subject: string;
/** Optional plain-text fallback. */
text?: string;
to: string | string[];
};
export type SendEmailResult = {
error: string;
sent: false;
} | {
messageId: string;
sent: true;
};
/**
* Sends an email using SMTP settings from the SiteIntegrations global.
*
* Reads config at call time (not at boot) so editors can change SMTP in the
* admin panel without a restart — consistent with the plugin's panel-managed
* model. `server-only` keeps the SMTP password out of any client bundle.
*
* Returns a result object rather than throwing, so callers (e.g. form
* submission) can handle failure without a try/catch and never leak SMTP
* details to the client.
*/
export declare function sendEmail({ from, html, payload, replyTo, subject, text, to, }: SendEmailArgs): Promise<SendEmailResult>;