Skip to content

feat: notification content options Phase 2 — Jinja2 title/body template strings #89

@gregoryfoster

Description

@gregoryfoster

Summary

Phase 2 of #88. Add title_template and body_template Jinja2 string fields to ContentOptions, enabling fully custom notification titles and bodies per config.

Design context

docs/plans/2026-04-14-notification-content-options-design.md — Phase 2 section:

ContentOptions gains title_template / body_template Jinja2 string fields. No schema migration needed — JSONB column already in place.

Scope

  • Add title_template: str | None and body_template: str | None to ContentOptions
  • Template context: all fields currently in WatchEvent + metadata keys (diff_lines, effective_domain, check_interval, etc.)
  • build_body() renders body_template via Jinja2 when set; falls back to Phase 1 additive composition otherwise
  • dispatch_event title override: render title_template when set (currently title is unchanged)
  • Dashboard: textarea inputs for template strings in the Content Options section (collapsed by default)
  • Template preview: render against a synthetic event (deferred if needed — can ship templates without live preview)

Out of scope

  • AI-powered summaries (separate future item)
  • Template variable autocomplete in the UI

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