fix: notification template preview and editor starter text disagree with what is actually sent

Open
#2,143 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@Wikid82 is already working on this.

Since Dec 3, 2026.

Assessment

This issue has not been assessed yet.

Description

backend bug frontend

What

The template preview and the editor's starter text use different variables from the send path.

Where

  • backend/internal/services/notification_service.go RenderTemplate renders against a flat map (used by notification_provider_handler.go Preview and notification_template_handler.go).
  • Sending uses the Hermes renderer, whose data is only Title, Message, Time, EventType and Data.
  • frontend/src/pages/Notifications.tsx:315 fills the editor with {{.HostName}}, {{.HostIP}}, {{.ServiceCount}}, {{.Services}}.

Evidence

  • With the Hermes webhook.RenderPreview, {{.HostName}} and {{.Timestamp}} render as <no value>; unquoted missing values make invalid JSON.
  • From reading the code: a working send template such as {{toJSON (index .Data "HostName")}} would fail in Preview, because the flat map has no Data key.

Severity

Medium.

Suggested approach

Make Preview use the same renderer and data shape as sending, and update the editor starter text to match.

Found while working on #2141.

Dominant language
Go
Stars
17
Forks
2
Avg merge
1h 42m
Merged PRs (30d)
173

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Wikid82/Charon

All issues in Wikid82/Charon

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.