feat(email-templates): categorise + link to feature flags

This commit is contained in:
Luca
2026-05-11 20:41:50 +02:00
parent 4e0d26d3f8
commit 84c06affb7
3 changed files with 119 additions and 0 deletions
+15
View File
@@ -17,11 +17,26 @@ export interface EmailTemplateTranslation {
body_text?: string;
}
/**
* Categorisation tag added by migration 098. Drives the admin
* Templates tab grouping — see EmailConfigPage. Forward-compatible:
* unknown values fall back to the 'core' section in the UI.
*/
export type EmailTemplateCategory = 'core' | 'customers' | 'billing' | 'quotes' | 'calendar' | 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;
/**
* 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;
}