Readable form emails (forms.emailLayout)

{{*:table}} renders a readable submission summary (questions, option labels,
grouped by step, empty fields skipped) inside an email template with logo,
accent colour and footer from Site Settings → Emails. submitForm stores the
submission in the page language, so emails follow the visitor's locale.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-17 01:29:00 +02:00
co-authored by Claude Opus 5.5
parent 78e4e0f8e6
commit 14d71bcc3a
10 changed files with 344 additions and 1 deletions
+4
View File
@@ -8,6 +8,8 @@ type BuildSiteSettingsArgs = {
additionalFields?: Field[]
/** "Under construction" tab (developer tool) — given when the pages module is on. */
constructionFields?: Field[]
/** "Emails" tab — given with `forms: { emailLayout: true }`. */
emailFields?: Field[]
/**
* Fields for the "System Pages" tab — page assignments by role (homepage,
* privacy policy, collection archives). Assembled by the caller, which is the
@@ -33,6 +35,7 @@ type BuildSiteSettingsArgs = {
export function buildSiteSettings({
additionalFields,
constructionFields,
emailFields,
systemPageFields,
}: BuildSiteSettingsArgs = {}): GlobalConfig {
return {
@@ -58,6 +61,7 @@ export function buildSiteSettings({
...(systemPageFields?.length
? [{ fields: systemPageFields, label: 'System Pages' }]
: []),
...(emailFields?.length ? [{ fields: emailFields, label: 'Emails' }] : []),
...(constructionFields?.length ? [{ fields: constructionFields, label: 'Under construction' }] : []),
...(additionalFields?.length ? [{ fields: additionalFields, label: 'Custom' }] : []),
],