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:
- In
SendNotification (line 166):
errs := tempNotifier.Send(message, nil)
- 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, ¶ms)
And in sendDirect:
params := types.Params{
"title": "Netronome Notification",
}
for _, err := range n.router.Send(message, ¶ms) {
This simple enhancement would allow Shoutrrr to correctly populate the title field in its payloads across all supported service backends.
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 thetitlefield 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
Sendmethod is called withnilparameters:SendNotification(line 166):sendDirect(line 388):Proposed Solution
We can use the
"github.com/containrrr/shoutrrr/pkg/types"package to pass atitleparameter to Shoutrrr via atypes.Paramsmap.Inside
SendNotification, we can determine a friendly title based on thecategoryandeventTypeparameters (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:
And in
sendDirect:This simple enhancement would allow Shoutrrr to correctly populate the
titlefield in its payloads across all supported service backends.