Skip to content
Permalink
Browse files

stop sending email if 'To' address slice empty

  • Loading branch information...
Pradeep Mishra
Pradeep Mishra committed Feb 5, 2018
1 parent 6a41655 commit f65e9569147eb85a3b72a14c5288ed128dbdf358
Showing with 5 additions and 0 deletions.
  1. +5 −0 cmd/bosun/conf/notify.go
@@ -188,6 +188,11 @@ func (n *Notification) PrepEmail(subject, body string, ak string, attachments []
}

func (p *PreparedEmail) Send(c SystemConfProvider) error {
// make sure "To" was not null
if len(p.To) <= 0 {
return nil
}

e := email.NewEmail()
e.From = c.GetEmailFrom()
for _, a := range p.To {

0 comments on commit f65e956

Please sign in to comment.
You can’t perform that action at this time.