Skip to content

Commit

Permalink
stop sending email if 'To' address slice empty (#2217)
Browse files Browse the repository at this point in the history
  • Loading branch information
pradeepbbl authored and Craig Peterson committed Mar 2, 2018
1 parent 8a14759 commit 7234211
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/bosun/conf/notify.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 7234211

Please sign in to comment.