Update notifications.md (#1842)

pull/1844/head
Simon Aronsson 1 year ago committed by GitHub
parent 1b898dbc70
commit 2dc0122873
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -57,6 +57,10 @@ outputs timestamp and log level.
custom format. custom format.
i.e., The day of the year has to be 1, the month has to be 2 (february), the hour 3 (or 15 for 24h time) etc. i.e., The day of the year has to be 1, the month has to be 2 (february), the hour 3 (or 15 for 24h time) etc.
!!! note "Skipping notifications"
To skip sending notifications that do not contain any information, you can wrap your template with `{{if .}}` and `{{end}}`.
Example: Example:
```bash ```bash
@ -101,7 +105,7 @@ It will be used to send a summary of every session if there are any containers t
Whenever the result of applying the template results in an empty string, no notifications will Whenever the result of applying the template results in an empty string, no notifications will
be sent. This is by default used to limit the notifications to only be sent when there something noteworthy occurred. be sent. This is by default used to limit the notifications to only be sent when there something noteworthy occurred.
You can replace `{{- if ( or .Updated .Failed ) -}}` with any logic you want to decide when to send the notifications. To skip all empty inputs, you can wrap your template with `{{if .}}` and `{{end}}`. You can replace `{{- if ( or .Updated .Failed ) -}}` with any logic you want to decide when to send the notifications.
Example using a custom report template that always sends a session report after each run: Example using a custom report template that always sends a session report after each run:

Loading…
Cancel
Save