Cart Settings
@@ -42,5 +62,16 @@ export default function Settings() {
+
+
Customer emails
+
+ The wording customers receive. Leave one alone and it sends the built-in copy.
+
+
+ {templates.map(template => (
+
+ ))}
+
+
);
}
diff --git a/frontend/src/admin/emailTemplatesApi.ts b/frontend/src/admin/emailTemplatesApi.ts
new file mode 100644
index 0000000..2a6d86b
--- /dev/null
+++ b/frontend/src/admin/emailTemplatesApi.ts
@@ -0,0 +1,56 @@
+export interface EmailTemplate {
+ key: string;
+ /** Human name for the card, so it is identifiable without reading the body. */
+ label: string;
+ /** Placeholders the body must keep. Saving without one is refused. */
+ required: string[];
+ /** Every placeholder this template understands. */
+ available: string[];
+ defaultSubject: string;
+ defaultBody: string;
+ /** Null when never customised, which is distinct from "same as the default". */
+ subject: string | null;
+ body: string | null;
+}
+
+async function json