events: allow setting a mapping for webhook transport to customise request payloads

closes #1383

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-09-12 01:02:51 +02:00
parent c779ad2e3b
commit 9a7fa39de4
14 changed files with 552 additions and 13 deletions

View File

@ -19,6 +19,14 @@ This will send a POST request to the given URL with the following contents:
The `Content-Type` header is set to `text/json`.
Starting in 2021.10, you can also select a Notification mapping. This allows you to freely configure the request's payload. For example:
```python
return {
"foo": context['notification'].body,
}
```
## Slack Webhook
This sends a request using the Slack-specific format. This is also compatible with Discord's webhooks by appending `/slack` to the Discord webhook URL.