Problem
Email templates (currently just password-reset and email-verification HTML/subject) are hardcoded as @ElementDefaultAttribute defaults on PasswordResetService/EmailVerificationService. Overriding them requires redeploying code or navigating the element-attribute resolution chain — and a custom Element's own @ElementDefaultAttribute re-declaration for the same key has no effect on the core element that actually reads it, since Tier-2 attribute defaults are scoped per-Element. There's no UI for managing this today.
Goal
Decouple email templates from the attribute system. Introduce a first-class, Mongo-backed EmailTemplate entity addressed by a key string:
- Core templates (password reset, email verification) use reserved, well-known keys and are auto-seeded.
- Custom Elements can mint their own keys and self-register templates via an idempotent
getOrCreate call, so their templates show up in the same admin UI with no core platform changes.
- Add an "Email Templates" page under the dashboard's "Other" sidebar category to list/edit these by key.
Scope
sdk-model: EmailTemplate model + create/update request DTOs
sdk-dao / mongo-dao / mongo-guice: EmailTemplateDao + Mongo implementation, unique index on key
sdk-service / service / service-guice: EmailTemplateService (standalone interface, Superuser + Unscoped access), reserved-key validation, getOrCreateEmailTemplate
rest-api: /email_template CRUD resource
- Migrate
AbstractPasswordResetService/AbstractEmailVerificationService off @ElementDefaultAttribute onto the new service
- Admin UI: new
EmailTemplates.tsx page, sidebar entry, routing
Problem
Email templates (currently just password-reset and email-verification HTML/subject) are hardcoded as
@ElementDefaultAttributedefaults onPasswordResetService/EmailVerificationService. Overriding them requires redeploying code or navigating the element-attribute resolution chain — and a custom Element's own@ElementDefaultAttributere-declaration for the same key has no effect on the core element that actually reads it, since Tier-2 attribute defaults are scoped per-Element. There's no UI for managing this today.Goal
Decouple email templates from the attribute system. Introduce a first-class, Mongo-backed
EmailTemplateentity addressed by akeystring:getOrCreatecall, so their templates show up in the same admin UI with no core platform changes.Scope
sdk-model:EmailTemplatemodel + create/update request DTOssdk-dao/mongo-dao/mongo-guice:EmailTemplateDao+ Mongo implementation, unique index onkeysdk-service/service/service-guice:EmailTemplateService(standalone interface, Superuser + Unscoped access), reserved-key validation,getOrCreateEmailTemplaterest-api:/email_templateCRUD resourceAbstractPasswordResetService/AbstractEmailVerificationServiceoff@ElementDefaultAttributeonto the new serviceEmailTemplates.tsxpage, sidebar entry, routing