Prepend fixed string to body (or title)
:bulb: The Idea
I'd like to be able to prepend a custom, fixed string to the notification body in my config. The immediate use case I have in mind is for notifications I send to Discord to prepend a user or role ping (<@&123>). I don't have easy means to control the notification body in the sending software, so it would be nice to be able to do this in the Apprise plugin config instead.
I personally want this for the body, but it would be nice to have similar functionality for the title as well.
:hammer: Breaking Feature I don't think it would.... This feature would be optional and could be entirely ignored by folks who don't need it.
FWIW, I thought about filing this feature request against Apprise API instead. I could see this being added to the existing custom webhook field mapping. But it seems to me it would be more generally useful in the core plugin config, so I filed the request here.
You can't just prepend this on the body before you send the message?
How are you sending the messages to Discord today?
I would need to think about the design a bit... It could possibly be something I add to the Apprise Asset object (allowing you to accomplish this as long as you're using a YAML based config file). There is a body and a title, and for some upstream services these get concatenated and for others their independent. So it may be a title_prefix you're looking for.
Just bouncing ideas at this point, but the request (to fit with other plugins globally) is a big deal.
Maybe what you need is just a ?ping= directive supported on the Discord URL instead? E.g:
discord://credential?ping=@joe
Possibly supporting tag, roles and users as accepted in the wiki?
Thoughts?
Hey, thank you for the thoughtful reply!
You can't just prepend this on the
bodybefore you send the message?How are you sending the messages to Discord today?
Not easily, because I don't generally own the code that sends the messages. I'm using Apprise API to send notifications (via Discord and email) from my homelab. For example:
- Komodo (via https://github.com/FoxxMD/deploy-apprise-alerter): This is a small project, and might take a PR to support modifying the body in this way, but generally it's just a straightforward passthrough of the alert message from Komodo.
- TrueNAS (via its built-in Slack webhook alerter, plus Apprise API's URL param mapping support): Generally they push back on "specialized" feature requests like this, and I suspect they wouldn't want message modification functionality.
Maybe what you need is just a
?ping=directive supported on the Discord URL instead? E.g:* `discord://credential?ping=@joe`Possibly supporting tag, roles and users as accepted in the wiki?
Sure, this would great! I was honestly trying to think of a more general solution, but you're right that I only really have a use case here for Discord. A ping option for the Discord plugin would totally work for me.