feat: add Slack target type for incoming webhook notifications #47

Merged
sneak merged 2 commits from feature/slack-target-type into main 2026-03-17 12:30:50 +01:00

2 Commits

Author SHA1 Message Date
user
a735252ffa fix: resolve review issues for Slack target type
All checks were successful
check / check (push) Successful in 1m53s
- Fix duplicate name="url" form fields by adding :disabled binding
  to each URL input so only the active target type's field submits
- Fix message formatting to use Slack mrkdwn (*bold*) instead of
  Markdown (**bold**) and remove language hint from code blocks
- Fix README line exceeding 80-column hard wrap
2026-03-17 03:49:01 -07:00
user
5f18e7c7bf feat: add Slack target type for incoming webhook notifications
All checks were successful
check / check (push) Successful in 2m2s
Add a new 'slack' target type that sends webhook events as formatted
messages to any Slack-compatible incoming webhook URL (Slack, Mattermost,
and other compatible services).

Messages include event metadata (method, content type, timestamp, body
size) and the payload pretty-printed in a code block. JSON payloads are
automatically formatted with indentation; non-JSON payloads are shown as
raw text. Large payloads are truncated at 3500 chars.

Changes:
- Add TargetTypeSlack constant to model_target.go
- Add SlackTargetConfig struct and deliverSlack method to delivery engine
- Add FormatSlackMessage (exported) for building Slack message text
- Route slack targets in processDelivery switch
- Handle slack type in HandleTargetCreate with webhook_url config
- Add slack option to source_detail.html target creation form
- Add comprehensive tests (config parsing, message formatting, delivery
  success/failure, routing)
- Update README with slack target documentation
2026-03-17 03:35:28 -07:00