make more than one email receipient possible

This commit is contained in:
Joerg Lehmann 2021-06-08 09:48:04 +02:00
parent c6c83ce708
commit 2d93042fff
1 changed files with 4 additions and 1 deletions

View File

@ -76,7 +76,10 @@ func sendAlert(deveui string, alertMessage string) {
emailalarmactive := getDevEmailAlarmactive(deveui) emailalarmactive := getDevEmailAlarmactive(deveui)
fmt.Printf("sendAlert: deveui=%s, email=%s, emailalarmactive=%s\n", deveui, email, emailalarmactive) fmt.Printf("sendAlert: deveui=%s, email=%s, emailalarmactive=%s\n", deveui, email, emailalarmactive)
if emailalarmactive == "1" { if emailalarmactive == "1" {
sendEmail(email, alertMessage) emails := strings.Split(email, ",")
for _, em := range emails {
sendEmail(em, alertMessage)
}
} }
} }