gate locale behind functional consent

This commit is contained in:
2026-08-12 18:03:11 +02:00
parent 195d4169f5
commit 4bf50514bf
212 changed files with 173 additions and 840 deletions
-3
View File
@@ -1,3 +0,0 @@
export { sendEmail } from './sendEmail.js';
//# sourceMappingURL=index.d.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["index.d.ts"],"sourcesContent":["export { sendEmail } from './sendEmail.js';\nexport type { SendEmailArgs, SendEmailResult } from './sendEmail.js';\n"],"names":["sendEmail"],"mappings":"AAAA,SAASA,SAAS,QAAQ,iBAAiB"}
-23
View File
@@ -1,23 +0,0 @@
/**
* Payload email adapter backed by the SMTP settings in the SiteIntegrations
* global.
*
* Why this exists: Payload builds its email adapter once, at boot, from the
* config — which would normally mean SMTP credentials living in env vars and a
* redeploy to change them. This adapter instead resolves SMTP on every send, so
* an editor can change the mailbox in the admin panel and the next email uses
* it.
*
* Wiring it into the config means `payload.sendEmail` works everywhere — which
* includes the form-builder's own submission emails (the ones an editor
* configures per form under "Emails"). Those go out over the panel's SMTP with
* no extra code.
*
* Boot-time constraints shape two details:
* - `defaultFromAddress` / `defaultFromName` must be returned synchronously, so
* they're placeholders; the real from-address is applied per message below.
* - nodemailer is imported dynamically inside sendEmail, so merely loading the
* Payload config (or running `generate:importmap`) doesn't pull it in.
*/ export { };
//# sourceMappingURL=panelSmtpAdapter.d.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["panelSmtpAdapter.d.ts"],"sourcesContent":["import type { PayloadEmailAdapter } from 'payload';\nexport type PanelSmtpAdapterArgs = {\n /**\n * Used only until the panel is filled in — Payload requires a from-address\n * synchronously at boot, before any global can be read. Once SiteIntegrations\n * has an address, it wins.\n */\n fallbackFromAddress?: string;\n fallbackFromName?: string;\n};\n/**\n * Payload email adapter backed by the SMTP settings in the SiteIntegrations\n * global.\n *\n * Why this exists: Payload builds its email adapter once, at boot, from the\n * config — which would normally mean SMTP credentials living in env vars and a\n * redeploy to change them. This adapter instead resolves SMTP on every send, so\n * an editor can change the mailbox in the admin panel and the next email uses\n * it.\n *\n * Wiring it into the config means `payload.sendEmail` works everywhere — which\n * includes the form-builder's own submission emails (the ones an editor\n * configures per form under \"Emails\"). Those go out over the panel's SMTP with\n * no extra code.\n *\n * Boot-time constraints shape two details:\n * - `defaultFromAddress` / `defaultFromName` must be returned synchronously, so\n * they're placeholders; the real from-address is applied per message below.\n * - nodemailer is imported dynamically inside sendEmail, so merely loading the\n * Payload config (or running `generate:importmap`) doesn't pull it in.\n */\nexport declare const panelSmtpAdapter: (args?: PanelSmtpAdapterArgs) => PayloadEmailAdapter;\n"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;;;;CAoBC,GACD,WAA4F"}
-3
View File
@@ -1,3 +0,0 @@
import 'server-only';
//# sourceMappingURL=sendEmail.d.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["sendEmail.d.ts"],"sourcesContent":["import 'server-only';\nimport type { BasePayload } from 'payload';\nexport type SendEmailArgs = {\n /** Override the configured from-address for this message. */\n from?: string;\n /** HTML body. */\n html: string;\n /** Payload instance — used to read SMTP config from SiteIntegrations. */\n payload: BasePayload;\n replyTo?: string;\n subject: string;\n /** Optional plain-text fallback. */\n text?: string;\n to: string | string[];\n};\nexport type SendEmailResult = {\n error: string;\n sent: false;\n} | {\n messageId: string;\n sent: true;\n};\n/**\n * Sends an email using SMTP settings from the SiteIntegrations global.\n *\n * Reads config at call time (not at boot) so editors can change SMTP in the\n * admin panel without a restart — consistent with the plugin's panel-managed\n * model. `server-only` keeps the SMTP password out of any client bundle.\n *\n * Returns a result object rather than throwing, so callers (e.g. form\n * submission) can handle failure without a try/catch and never leak SMTP\n * details to the client.\n */\nexport declare function sendEmail({ from, html, payload, replyTo, subject, text, to, }: SendEmailArgs): Promise<SendEmailResult>;\n"],"names":[],"mappings":"AAAA,OAAO,cAAc"}