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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user