Honor email-templates.active for order-confirmation

Skips the send entirely when the admin has deliberately deactivated
the order-confirmation template, matching the backend's new toggle for
the 7 order-status emails. Distinct from a missing row, which still
sends with the hardcoded default wording.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Marco
2026-07-25 22:58:41 +00:00
parent 0436e87147
commit 1d875a65c0
2 changed files with 13 additions and 1 deletions
+5
View File
@@ -828,6 +828,11 @@ type PayloadEmailTemplate = {
heading: string;
bodyText: string;
footerText: string | null;
// false means the admin deliberately suppressed this email — checked
// by orderEmail.ts before sending order-confirmation, never treated as
// "row missing, use hardcoded default" (that's what a null return from
// this function itself already means).
active: boolean;
};
// draft:true is used by app/email-preview/[type]/page.tsx (Live Preview,