Page body
What this form does
This form is used to create or edit one notification template.
Operators use it to maintain:
- the internal notification title
- localized notification content
- sender display name and avatar
- notification priority
- notification-email merge variables shown to operators as a helper reference
- the email-template link that gives the notification route an HTML shell
Create vs edit
Entry paths
Notificationslist opens/notifications/createwithout a linkedemailTemplateId.Email Templates -> Notificationscan deep-link into/notifications/create?emailTemplateId=:emailTemplateIdwhen an email-template row does not yet have a linked notification.
Create
The create flow can start with or without an existing linked email-template ID in the route.
If no emailTemplateId is present, the frontend first creates a minimal email-template record, then creates the notification record, and finally links the two through update-email-template with notificationId and notificationActive: true.
Edit
The edit flow loads the notification record directly from GET /api/admin/notifications/:notificationId and saves it through PUT /api/admin/notifications/:notificationId.
The operator stays focused on localized notification HTML content. The linked email-template HTML shell stays outside this surface and is still previewed from the list route.
Visible helper surfaces
Language Tabswitches the locale shown in the content editor.Translatefills only missing non-English locales from the current EN body.Force Translateoverwrites every non-English locale from the current EN body.Available Variablesshows the merge keys that are safe to use in notification content.Sender Avatar Sourceswitches between direct URL mode and asset-library mode.
Important actions
Create & Continueon createSaveon editTranslateForce TranslateCancel
Known caveats
- The operator form does not currently expose backend
sendEmail, even thoughPOST /api/admin/notificationssupports that flag. - The form does not render a standalone preview card. HTML preview still lives on the list route through the linked email-template row.
- Create uses a mixed backend path: first email-template creation when needed, then notification creation, then email-template linkage.
- The FE has no visible
Notification Typeselector. Create and edit both operate as template notifications and the edit flow sendsnotificationType: 'broadcast'. - The FE hard-requires only EN content.
Titleis still required by the backend create route, so an empty title can pass FE validation and then fail on save. - Edit starts in
URLavatar mode by default. Existing image URLs are loaded, but the FE does not back-resolve a saved avatar into the asset picker. - The visible priority slider shows labels up to
Max, but the current FE control range is effectively limited to0and1.
Verification status
- status:
verified_backend - verified backend routes:
POST /api/admin/notificationsGET /api/admin/notifications/:notificationIdPUT /api/admin/notifications/:notificationIdPOST /api/admin/create-email-templatePUT /api/admin/update-email-template