mirror of
https://github.com/crazy-max/diun.git
synced 2025-12-31 10:07:23 +01:00
Option to render fields (#480)
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 15 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
@@ -15,8 +15,8 @@ Allow to send notifications to your Discord channel.
|
||||
- "<@124>"
|
||||
- "<@125>"
|
||||
- "<@&200>"
|
||||
renderFields: true
|
||||
timeout: 10s
|
||||
templateTitle: "{{ .Entry.Image }} released"
|
||||
templateBody: |
|
||||
Docker tag {{ .Entry.Image }} which you subscribed to through {{ .Entry.Provider }} provider has been released.
|
||||
```
|
||||
@@ -25,23 +25,17 @@ Allow to send notifications to your Discord channel.
|
||||
|---------------------|---------------------------------------|---------------|
|
||||
| `webhookURL`[^1] | | Discord [incoming webhook URL](https://support.discord.com/hc/en-us/articles/228383668-Intro-to-Webhooks) |
|
||||
| `mentions` | | List of users or roles to notify |
|
||||
| `renderFields` | `true` | Render [field objects](https://discordjs.guide/popular-topics/embeds.html) |
|
||||
| `timeout` | `10s` | Timeout specifies a time limit for the request to be made |
|
||||
| `templateTitle`[^1] | See [below](#default-templatetitle) | [Notification template](../faq.md#notification-template) for message title |
|
||||
| `templateBody`[^1] | See [below](#default-templatebody) | [Notification template](../faq.md#notification-template) for message body |
|
||||
|
||||
!!! abstract "Environment variables"
|
||||
* `DIUN_NOTIF_DISCORD_WEBHOOKURL`
|
||||
* `DIUN_NOTIF_DISCORD_MENTIONS` (comma separated)
|
||||
* `DIUN_NOTIF_DISCORD_RENDERFIELDS`
|
||||
* `DIUN_NOTIF_DISCORD_TIMEOUT`
|
||||
* `DIUN_NOTIF_DISCORD_TEMPLATETITLE`
|
||||
* `DIUN_NOTIF_DISCORD_TEMPLATEBODY`
|
||||
|
||||
### Default `templateTitle`
|
||||
|
||||
```
|
||||
[[ config.extra.template.defaultTitle ]]
|
||||
```
|
||||
|
||||
### Default `templateBody`
|
||||
|
||||
```
|
||||
|
||||
@@ -12,6 +12,7 @@ Allow to send notifications to your Rocket.Chat channel.
|
||||
channel: "#general"
|
||||
userID: abcdEFGH012345678
|
||||
token: Token123456
|
||||
renderAttachment: true
|
||||
timeout: 10s
|
||||
templateTitle: "{{ .Entry.Image }} released"
|
||||
templateBody: |
|
||||
@@ -25,6 +26,7 @@ Allow to send notifications to your Rocket.Chat channel.
|
||||
| `userID`[^1] | | User ID |
|
||||
| `token` | | Authentication token |
|
||||
| `tokenFile` | | Use content of secret file as authentication token if `token` not defined |
|
||||
| `renderAttachment` | `true` | Render [attachment object](https://docs.rocket.chat/guides/user-guides/messaging#send-attachments) |
|
||||
| `timeout` | `10s` | Timeout specifies a time limit for the request to be made |
|
||||
| `templateTitle`[^1] | See [below](#default-templatetitle) | [Notification template](../faq.md#notification-template) for message title |
|
||||
| `templateBody`[^1] | See [below](#default-templatebody) | [Notification template](../faq.md#notification-template) for message body |
|
||||
@@ -38,6 +40,7 @@ Allow to send notifications to your Rocket.Chat channel.
|
||||
* `DIUN_NOTIF_ROCKETCHAT_USERID`
|
||||
* `DIUN_NOTIF_ROCKETCHAT_TOKEN`
|
||||
* `DIUN_NOTIF_ROCKETCHAT_TOKENFILE`
|
||||
* `DIUN_NOTIF_ROCKETCHAT_RENDERATTACHMENT`
|
||||
* `DIUN_NOTIF_ROCKETCHAT_TIMEOUT`
|
||||
* `DIUN_NOTIF_ROCKETCHAT_TEMPLATETITLE`
|
||||
* `DIUN_NOTIF_ROCKETCHAT_TEMPLATEBODY`
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -9,6 +9,7 @@ You can send notifications to your Teams team-channel using an [incoming webhook
|
||||
notif:
|
||||
teams:
|
||||
webhookURL: https://outlook.office.com/webhook/ABCD12EFG/HIJK34LMN/01234567890abcdefghij
|
||||
renderFacts: true
|
||||
templateBody: |
|
||||
Docker tag {{ .Entry.Image }} which you subscribed to through {{ .Entry.Provider }} provider has been released.
|
||||
```
|
||||
@@ -16,10 +17,12 @@ You can send notifications to your Teams team-channel using an [incoming webhook
|
||||
| Name | Default | Description |
|
||||
|--------------------|--------------------------------------------|---------------|
|
||||
| `webhookURL`[^1] | | Teams [incoming webhook URL](https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/what-are-webhooks-and-connectors) |
|
||||
| `renderFacts` | `true` | Render fact objects |
|
||||
| `templateBody`[^1] | See [below](#default-templatebody) | [Notification template](../faq.md#notification-template) for message body |
|
||||
|
||||
!!! abstract "Environment variables"
|
||||
* `DIUN_NOTIF_TEAMS_WEBHOOKURL`
|
||||
* `DIUN_NOTIF_TEAMS_RENDERFACTS`
|
||||
* `DIUN_NOTIF_TEAMS_TEMPLATEBODY`
|
||||
|
||||
### Default `templateBody`
|
||||
|
||||
Reference in New Issue
Block a user