Skip to content

Commit

Permalink
fix: Log if send mail fails, VERSION v0.7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejsika committed May 26, 2021
1 parent 9a24ae0 commit f7a8b3a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion alerting/backend_email/backend_email.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package backend_email

import (
"errors"
"fmt"
"os"

gosendmail "github.com/ondrejsika/gosendmail/lib"
"github.com/sikalabs/tergum/backup_log"
Expand Down Expand Up @@ -57,12 +59,15 @@ func SendAlertEmail(
) error {
table := backup_log.GlobalLogToString(globalLog)
for _, email := range alert.Emails {
sendMail(
err := sendMail(
backendConfig,
email,
"Backup Summary -- "+globalLog.SuccessString(),
table,
)
if err != nil {
fmt.Fprintf(os.Stderr, "%s\n", err.Error())
}
}
return nil
}

0 comments on commit f7a8b3a

Please sign in to comment.