summaryrefslogtreecommitdiff
path: root/notifications.go
diff options
context:
space:
mode:
authorJan Dittberner <jandd@cacert.org>2019-07-31 14:14:21 +0200
committerJan Dittberner <jandd@cacert.org>2019-07-31 14:14:21 +0200
commit2d7f0cc0e309046607c7bb15954fb258c37efab7 (patch)
tree03a77da9e17f96c29e51e2f04fa67b7b9cde075c /notifications.go
parent870e3ab1d2deed3a601bd6ba96856c3a00d89eb3 (diff)
downloadcacert-boardvoting-2d7f0cc0e309046607c7bb15954fb258c37efab7.tar.gz
cacert-boardvoting-2d7f0cc0e309046607c7bb15954fb258c37efab7.tar.xz
cacert-boardvoting-2d7f0cc0e309046607c7bb15954fb258c37efab7.zip
Modernize Go code
- switch from go-logging to logrus - handle all errors - use gomail's NewDialer instead of deprecated NewPlainDialer
Diffstat (limited to 'notifications.go')
-rw-r--r--notifications.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/notifications.go b/notifications.go
index 25234ff..28c6a21 100644
--- a/notifications.go
+++ b/notifications.go
@@ -7,6 +7,8 @@ import (
"github.com/Masterminds/sprig"
"gopkg.in/gomail.v2"
"text/template"
+
+ log "github.com/sirupsen/logrus"
)
type headerData struct {
@@ -57,7 +59,7 @@ func MailNotifier(quitMailNotifier chan int) {
}
m.SetBody("text/plain", mailText.String())
- d := gomail.NewPlainDialer(config.MailServer.Host, config.MailServer.Port, "", "")
+ d := gomail.NewDialer(config.MailServer.Host, config.MailServer.Port, "", "")
if err := d.DialAndSend(m); err != nil {
log.Errorf("sending mail failed: %v", err)
}