Operator guideENnotificationsform

Notifications / Form

Create and edit workflow for one notification template, including localized content, sender avatar, and priority settings.

Reader view

Clean portal guidance

This page keeps the operator explanation, field and action descriptions, and screenshots visible without exposing repo paths, raw sidecars, or editorial-only implementation details.

Narrative content

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

  • Notifications list opens /notifications/create without a linked emailTemplateId.
  • Email Templates -> Notifications can deep-link into /notifications/create?emailTemplateId=:emailTemplateId when 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 Tab switches the locale shown in the content editor.
  • Translate fills only missing non-English locales from the current EN body.
  • Force Translate overwrites every non-English locale from the current EN body.
  • Available Variables shows the merge keys that are safe to use in notification content.
  • Sender Avatar Source switches between direct URL mode and asset-library mode.

Important actions

  • Create & Continue on create
  • Save on edit
  • Translate
  • Force Translate
  • Cancel

Known caveats

  • The operator form does not currently expose backend sendEmail, even though POST /api/admin/notifications supports 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 Type selector. Create and edit both operate as template notifications and the edit flow sends notificationType: 'broadcast'.
  • The FE hard-requires only EN content. Title is still required by the backend create route, so an empty title can pass FE validation and then fail on save.
  • Edit starts in URL avatar 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 to 0 and 1.

Verification status

  • status: verified_backend
  • verified backend routes:
    • POST /api/admin/notifications
    • GET /api/admin/notifications/:notificationId
    • PUT /api/admin/notifications/:notificationId
    • POST /api/admin/create-email-template
    • PUT /api/admin/update-email-template
Field dictionary

Fields

field

Title (Internal)

Internal notification name used by operators to identify the template.

Data Type
string
field

Custom From

Optional sender display name shown together with the notification.

Data Type
string
field

Sender Avatar Source

Chooses whether the sender avatar comes from a direct URL or the asset library.

Data Type
enum
field

Image URL

Direct avatar image URL used when the operator chooses URL mode.

Data Type
string
field

Selected Asset

Asset-library image selected as the sender avatar.

Data Type
asset-reference
field

Priority Level

Delivery priority used by the notification workflow.

Data Type
integer
Caveats
The slider UI shows marks for `Regular`, `Important`, `High`, `Critical`, and `Max`, but the current FE control range effectively allows only `0` and `1`.
field

Language Tab

Selects which locale version of notification content the operator is editing.

Data Type
enum
field

Content

Localized notification body that will be stored in the notification record.

Data Type
rich-text
field

Available Variables

Read-only helper panel that shows `Special` and `Common` merge-variable chips available to the notification template.

Data Type
helper-panel
Caveats
The shared helper text still mentions content and subject because the panel is reused from email-template tooling, even though this form only edits notification content.
Operational notes

Notes

item

Operators can reach create from two places: the notifications inventory (`/notifications/create`) or the email-template notifications tab (`/notifications/create?emailTemplateId=:id`).

item

The create flow may create a minimal email-template first, then create the notification record, then link the notification back to the template row.

item

The edit flow reads and saves the notification record directly through `/api/admin/notifications/:notificationId`.

item

Backend create supports `sendEmail`, but the current operator form does not surface that control.

item

The FE does not expose a visible notification-type selector. Create passes the form value initialized as `broadcast`, and edit saves `notificationType: 'broadcast'`.

item

The visible `Available Variables` panel is a helper surface backed by `useEmailDynamicData`; it does not write to the notification record by itself.

item

The form does not render an inline preview card. HTML preview remains on list-level email-template rows through `NotificationTemplates.tsx` and `EmailTemplates.tsx`.

item

Create FE validation hard-requires EN content but not title. `POST /api/admin/notifications` still requires both title and content, so empty-title saves can fail server-side.

item

Edit defaults to `url` avatar mode and does not resolve a previously saved image URL back into the asset selector.

Related references

Related pages

pageNotifications

Operator workspace for notification-template inventory, linked email-template status, and notification create or edit workflow.

pageNotifications / List

Notification-template inventory built from linked email-template rows, with create navigation, edit navigation, HTML preview, and linked status toggle.

pageAffiliate Deals / Form

Create and edit form for affiliate deals, including PID, date window, commercial terms, and responsible person.

pageAffiliate Payment Settings / Form

Create and edit form for one affiliate payment-setting record, with visible PID targeting, minimum deposit threshold, and active-state control.

pageAuto Tags Manager / Create

Full rule-builder for a new automatic tagging rule, including tag actions, coupon actions, KPI field selection, and draft impact estimation.

pageAutomatic Withdrawal / Form

Create and edit form for one automatic-withdrawal rule, including thresholds, KYC, countries, methods, tags, and per-currency limits.