Merge pull request #464 from Luca-Timo/feat/email-templates-reorg

Feat/email templates reorg
This commit is contained in:
Paul Nothaft
2026-05-11 21:44:17 +02:00
committed by GitHub
12 changed files with 1487 additions and 15 deletions
+26
View File
@@ -17,11 +17,37 @@ export interface EmailTemplateTranslation {
body_text?: string;
}
/**
* Top-level grouping in the admin Templates UI. Forward-compatible:
* unknown values fall back to the 'core' section.
*/
export type EmailTemplateCategory = 'core' | 'customers' | 'billing' | 'quotes' | 'calendar' | string;
/**
* Second-level grouping inside 'core' (which is busy enough to deserve
* its own sub-headers). Other categories ignore this field.
*/
export type EmailTemplateSubcategory = 'gallery' | 'admin' | 'backup' | 'system' | string;
export interface EmailTemplate {
id: number;
template_key: string;
variables: string[];
translations: Record<string, EmailTemplateTranslation>;
/** Display group (migration 098). Defaults to 'core' if absent. */
category?: EmailTemplateCategory;
/**
* Second-level group inside `core`. Migration 098 backfill assigns
* one of 'gallery' | 'admin' | 'backup' | 'system'; NULL for
* templates outside `core`.
*/
subcategory?: EmailTemplateSubcategory | null;
/**
* Name of the feature flag whose `false` state should mark this
* template as "Feature off" in the admin UI. `null` = always
* active. Migration 098 backfills these.
*/
feature_flag?: string | null;
updated_at: string;
}