Slack Provider: Fixes slack_username and adds slack_icon_emoji
Hi, this PR fixes and implements the use of the slack_username configuration, which was previously non-functional.
I'm also adding slack_icon_emoji, which sets the emoji for the username. When adding this, I noticed that shoutrrr does not support setting icon_emoji in Slack messages.
Slack expects the icon_emoji to be included in the JSON payload of the POST request, but shoutrrr only supports basic message text and allows the username through a query parameter — it does not permit modifying the JSON payload structure to include icon_emoji.
To fully support both username and emoji, I replaced the shoutrrr.Send() call with a simple http.Post using a custom JSON payload. This provides complete control and ensures compatibility with Slack’s webhook API.
I hope this is okay. If not, I can leave the slack_icon_emoji out of this PR and revert to the shoutrrr implementation, but at least it will make the slack_username work.
Summary by CodeRabbit
-
New Features
- Added support for customizing the Slack message icon using an emoji when sending notifications.
-
Documentation
- Updated the example configuration in the README to show how to set a custom emoji icon for Slack notifications.