Skip to content

Slack webhook notificationย #7031

@martinjgrunwald

Description

@martinjgrunwald

Summary

More examples for webhooks should be given in the documentation

Motivation

Currently, the generate_config.sh contains an example notification to Discord. There are other services like Slack or Telegram that can receive notifications via webhooks

Additional context

I tried to send Slack notifications using this syntax from the documentation:

# JSON body included in the webhook POST request. Needs to be in single quotes.
# Following variables are available: SUBJECT, BODY
#WATCHDOG_NOTIFY_WEBHOOK_BODY='{"username": "mailcow Watchdog", "content": "**${SUBJECT}**\n${BODY}"}'

I did not get any notification because for Slack, content needs to be renamed to text. Also, Slack uses one * instead of two for bold text.
My code now looks like this:
WATCHDOG_NOTIFY_WEBHOOK_BODY='{"username": "mailcow Watchdog", "text": "*${SUBJECT}*\n${BODY}"}'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions