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

Abierto
#2,143 0 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@Wikid82 ya está trabajando en esto.

Desde el 3/12/2026.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

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.

Lenguaje dominante
Go
Estrellas
17
Forks
2
Merge medio
1 h 42 min
PR fusionados (30 d)
173

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Wikid82/Charon

Todos los issues de Wikid82/Charon

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.