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
+9
View File
@@ -315,6 +315,12 @@ router.get('/templates', adminAuth, requirePermission('email.view'), async (req,
template_key: template.template_key,
variables: parseVariables(template),
translations,
// Categorisation + feature-flag link added by migration 098.
// Older installs that haven't run the migration yet return
// 'core' / null fall-backs so the frontend keeps working
// without a hard dependency on the new columns.
category: template.category || 'core',
feature_flag: template.feature_flag || null,
updated_at: template.updated_at,
});
}
@@ -344,6 +350,9 @@ router.get('/templates/:key', adminAuth, requirePermission('email.view'), async
template_key: template.template_key,
variables: parseVariables(template),
translations,
// See list endpoint for the rationale on the || fallbacks.
category: template.category || 'core',
feature_flag: template.feature_flag || null,
updated_at: template.updated_at,
});
} catch (error) {