Skip to content

[Feature Request] Add "title" parameter to Shoutrrr notification payloads #229

@bl4ckswordsman

Description

@bl4ckswordsman

Description:

Describe the Feature

Currently, when Netronome triggers alerts or notifies on speed test completions, it sends the notification message text via Shoutrrr, but does not specify a title parameter in the Shoutrrr call context.

As a result, when using notification services that support separate titles - such as Shoutrrr's generic webhook receiver using template=json- the generated JSON payload leaves the title field empty:

{
  "title": "",
  "message": "Speed test completed! \nDownload: 940 Mbps\nUpload: 930 Mbps..."
}

This empty title field breaks downstream integrations (like chat bot plugins/generic webhooks) that rely on a separate title to manage push notification previews or format messages cleanly.

Code Reference

In internal/notifications/notifications.go, Shoutrrr's Send method is called with nil parameters:

  1. In SendNotification (line 166):
    errs := tempNotifier.Send(message, nil)
  2. In sendDirect (line 388):
    for _, err := range n.router.Send(message, nil) {

Proposed Solution

We can use the "github.com/containrrr/shoutrrr/pkg/types" package to pass a title parameter to Shoutrrr via a types.Params map.

Inside SendNotification, we can determine a friendly title based on the category and eventType parameters (e.g., mapping them to cleaner titles like "Netronome Speedtest Complete", "Netronome Agent Offline", etc., or just generating a generic "Netronome: [Category]" title).

For example:

import (
	// ... other imports ...
	"github.com/containrrr/shoutrrr/pkg/types"
)

// In SendNotification:
title := "Netronome Alert"
if category != "" {
	// e.g., format category dynamically or map it
	title = fmt.Sprintf("Netronome: %s", strings.Title(category)) 
}

params := types.Params{
	"title": title,
}

errs := tempNotifier.Send(message, &params)

And in sendDirect:

params := types.Params{
	"title": "Netronome Notification",
}
for _, err := range n.router.Send(message, &params) {

This simple enhancement would allow Shoutrrr to correctly populate the title field in its payloads across all supported service backends.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions