Option to render fields (#480)

Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2021-09-04 18:41:42 +02:00
committed by GitHub
parent fe8482999c
commit fc64b132ff
19 changed files with 202 additions and 164 deletions

View File

@@ -12,6 +12,7 @@ You can send notifications to your Slack channel using an [incoming webhook URL]
notif:
slack:
webhookURL: https://hooks.slack.com/services/ABCD12EFG/HIJK34LMN/01234567890abcdefghij
renderFields: true
templateBody: |
Docker tag {{ .Entry.Image }} which you subscribed to through {{ .Entry.Provider }} provider has been released.
```
@@ -19,16 +20,18 @@ You can send notifications to your Slack channel using an [incoming webhook URL]
| Name | Default | Description |
|--------------------|--------------------------------------------|---------------|
| `webhookURL`[^1] | | Slack [incoming webhook URL](https://api.slack.com/messaging/webhooks) |
| `renderFields` | `true` | Render [field objects](https://api.slack.com/messaging/composing/layouts#stack_of_blocks) |
| `templateBody`[^1] | See [below](#default-templatebody) | [Notification template](../faq.md#notification-template) for message body |
!!! abstract "Environment variables"
* `DIUN_NOTIF_SLACK_WEBHOOKURL`
* `DIUN_NOTIF_SLACK_RENDERFIELDS`
* `DIUN_NOTIF_SLACK_TEMPLATEBODY`
### Default `templateBody`
```
<!channel> Docker tag `{{ .Entry.Image }}` {{ if (eq .Entry.Status "new") }}newly added{{ else }}updated{{ end }}.
<!channel> Docker tag {{ if .Entry.Image.HubLink }}<{{ .Entry.Image.HubLink }}|`{{ .Entry.Image }}`>{{ else }}`{{ .Entry.Image }}`{{ end }} {{ if (eq .Entry.Status "new") }}available{{ else }}updated{{ end }}.
```
## Sample