chore: update notification template

This commit is contained in:
2024-12-07 17:36:05 +01:00
parent 156f22f1e5
commit 8e58d7a4c3
7 changed files with 147 additions and 36 deletions

View File

@@ -50,6 +50,7 @@ type ErrorMessage struct {
EndTime string
Error string
BackupReference string
DatabaseName string
}
// loadMailConfig gets mail environment variables and returns MailConfig
@@ -81,3 +82,5 @@ func backupReference() string {
}
const templatePath = "/config/templates"
var DatabaseName = ""

View File

@@ -167,6 +167,7 @@ func NotifyError(error string) {
Error: error,
EndTime: time.Now().Format(TimeFormat()),
BackupReference: os.Getenv("BACKUP_REFERENCE"),
DatabaseName: DatabaseName,
}, "email-error.tmpl")
if err != nil {
Error("Could not parse error template: %v", err)
@@ -183,6 +184,7 @@ func NotifyError(error string) {
Error: error,
EndTime: time.Now().Format(TimeFormat()),
BackupReference: os.Getenv("BACKUP_REFERENCE"),
DatabaseName: DatabaseName,
}, "telegram-error.tmpl")
if err != nil {
Error("Could not parse error template: %v", err)