Skip to content

Commit

Permalink
Merge pull request #1878 from cubismod/webhook-params
Browse files Browse the repository at this point in the history
Docs update describing available variables for webhook templating
  • Loading branch information
umputun authored Dec 21, 2024
2 parents 3f0789f + e1166a4 commit be076d0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions site/src/docs/configuration/notifications/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,16 @@ If all goes fine, you should be able to see the following message on your Slack
You need to set `NOTIFY_ADMINS=webhook` to enable WebHook notifications on all new comments and set at least `NOTIFY_WEBHOOK_URL` for them to start working.

Additionally, you might want to set `NOTIFY_WEBHOOK_TEMPLATE` (which is Go Template, `{"text": {{.Text | escapeJSONString}}}` by default) and `NOTIFY_WEBHOOK_HEADERS`, which is HTTP header(s) in format `Header1:Value1,Header2:Value2,...`.

Here are some additional common variables that you can use with your template:

| Variable | Type | Description |
|---------------|-------------|-------------------------------------------------------------------------------------------------------|
| `ID` | `string` | |
| `Text` | `string` | |
| `User.Name` | `string` | [Full struct defined here](https://github.com/umputun/remark42/blob/master/backend/app/store/user.go) |
| `Locator.URL` | `string` | Post URL |
| `Score` | `int` | |
| `Timestamp` | `time.Time` | |

All possible variables are available in the [`Comment struct`](https://github.com/umputun/remark42/blob/master/backend/app/store/comment.go)

0 comments on commit be076d0

Please sign in to comment.