From 15a92816248ccecab91ac838fc1d1702a4a71278 Mon Sep 17 00:00:00 2001 From: Simon Aronsson Date: Fri, 10 Jan 2020 22:30:52 +0100 Subject: [PATCH] feat: add support for multiple email recipients --- pkg/notifications/email.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/notifications/email.go b/pkg/notifications/email.go index ca54499..fe4ca03 100644 --- a/pkg/notifications/email.go +++ b/pkg/notifications/email.go @@ -6,6 +6,7 @@ import ( "github.com/spf13/cobra" "net/smtp" "os" + "strings" "time" t "github.com/containrrr/watchtower/pkg/types" @@ -113,7 +114,7 @@ func (e *emailTypeNotifier) sendEntries(entries []*log.Entry) { if e.User != "" { auth = smtp.PlainAuth("", e.User, e.Password, e.Server) } - err := SendMail(e.Server+":"+strconv.Itoa(e.Port), e.tlsSkipVerify, auth, e.From, []string{e.To}, msg) + err := SendMail(e.Server+":"+strconv.Itoa(e.Port), e.tlsSkipVerify, auth, e.From, strings.Split(e.To, ","), msg) if err != nil { // Use fmt so it doesn't trigger another email. fmt.Println("Failed to send notification email: ", err)