mirror of
https://github.com/jkaninda/mysql-bkup.git
synced 2025-12-06 13:39:41 +01:00
chore: update notification template
This commit is contained in:
@@ -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 = ""
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user