docs: update notification template

This commit is contained in:
Jonas Kaninda
2024-10-22 16:55:28 +02:00
parent 9c1bdccae5
commit 9c804aff3d
6 changed files with 8 additions and 8 deletions

View File

@@ -74,10 +74,10 @@ networks:
The title and body of the notifications can be tailored to your needs using Go templates. The title and body of the notifications can be tailored to your needs using Go templates.
Template sources must be mounted inside the container in /config/templates: Template sources must be mounted inside the container in /config/templates:
- email.template: Email notification template - email.tmpl: Email notification template
- telegram.template: Telegram notification template - telegram.tmpl: Telegram notification template
- email-error.template: Error notification template - email-error.tmpl: Error notification template
- telegram-error.template: Error notification template - telegram-error.tmpl: Error notification template
### Data ### Data

View File

@@ -99,7 +99,7 @@ func NotifySuccess(notificationData *NotificationData) {
//Email notification //Email notification
err := CheckEnvVars(mailVars) err := CheckEnvVars(mailVars)
if err == nil { if err == nil {
body, err := parseTemplate(*notificationData, "email.template") body, err := parseTemplate(*notificationData, "email.tmpl")
if err != nil { if err != nil {
Error("Could not parse email template: %v", err) Error("Could not parse email template: %v", err)
} }
@@ -111,7 +111,7 @@ func NotifySuccess(notificationData *NotificationData) {
//Telegram notification //Telegram notification
err = CheckEnvVars(vars) err = CheckEnvVars(vars)
if err == nil { if err == nil {
message, err := parseTemplate(*notificationData, "telegram.template") message, err := parseTemplate(*notificationData, "telegram.tmpl")
if err != nil { if err != nil {
Error("Could not parse telegram template: %v", err) Error("Could not parse telegram template: %v", err)
} }
@@ -143,7 +143,7 @@ func NotifyError(error string) {
Error: error, Error: error,
EndTime: time.Now().Format(TimeFormat()), EndTime: time.Now().Format(TimeFormat()),
BackupReference: os.Getenv("BACKUP_REFERENCE"), BackupReference: os.Getenv("BACKUP_REFERENCE"),
}, "email-error.template") }, "email-error.tmpl")
if err != nil { if err != nil {
Error("Could not parse error template: %v", err) Error("Could not parse error template: %v", err)
} }
@@ -159,7 +159,7 @@ func NotifyError(error string) {
Error: error, Error: error,
EndTime: time.Now().Format(TimeFormat()), EndTime: time.Now().Format(TimeFormat()),
BackupReference: os.Getenv("BACKUP_REFERENCE"), BackupReference: os.Getenv("BACKUP_REFERENCE"),
}, "telegram-error.template") }, "telegram-error.tmpl")
if err != nil { if err != nil {
Error("Could not parse error template: %v", err) Error("Could not parse error template: %v", err)