Skip to content

Add Mongo-backed Email Templates with admin UI editor #79

Description

@krh372

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions