mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-14 14:10:12 +01:00
Merge pull request #436 from containrrr/feature/multiple-email-recipients
feat: add support for multiple email recipients
This commit is contained in:
commit
4e000fa89c
1 changed files with 2 additions and 1 deletions
|
|
@ -6,6 +6,7 @@ import (
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"net/smtp"
|
"net/smtp"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
t "github.com/containrrr/watchtower/pkg/types"
|
t "github.com/containrrr/watchtower/pkg/types"
|
||||||
|
|
@ -113,7 +114,7 @@ func (e *emailTypeNotifier) sendEntries(entries []*log.Entry) {
|
||||||
if e.User != "" {
|
if e.User != "" {
|
||||||
auth = smtp.PlainAuth("", e.User, e.Password, e.Server)
|
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 {
|
if err != nil {
|
||||||
// Use fmt so it doesn't trigger another email.
|
// Use fmt so it doesn't trigger another email.
|
||||||
fmt.Println("Failed to send notification email: ", err)
|
fmt.Println("Failed to send notification email: ", err)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue