Commit 4d03e041 by bergquist

feat(alerting): enable email notifiter

parent 2e809cae
...@@ -46,23 +46,23 @@ type Notification struct { ...@@ -46,23 +46,23 @@ type Notification struct {
type EmailNotifier struct { type EmailNotifier struct {
To string To string
From string
log log.Logger log log.Logger
} }
func (this *EmailNotifier) Dispatch(alertResult *AlertResult) { func (this *EmailNotifier) Dispatch(alertResult *AlertResult) {
/*
this.log.Info("Sending email") this.log.Info("Sending email")
cmd := &m.SendEmailCommand{ cmd := &m.SendEmailCommand{
Data: map[string]interface{}{}, Data: map[string]interface{}{
To: []string{}, "Description": alertResult.Description,
Info: "", "TriggeredAlerts": alertResult.TriggeredAlerts,
},
To: []string{this.To},
Info: "Alert result",
Massive: false, Massive: false,
Template: "", Template: "",
} }
bus.Dispatch(cmd) bus.Dispatch(cmd)
*/
} }
type WebhookNotifier struct { type WebhookNotifier struct {
...@@ -125,7 +125,6 @@ var createNotifier = func(notificationType string, settings *simplejson.Json) No ...@@ -125,7 +125,6 @@ var createNotifier = func(notificationType string, settings *simplejson.Json) No
if notificationType == "email" { if notificationType == "email" {
return &EmailNotifier{ return &EmailNotifier{
To: settings.Get("to").MustString(), To: settings.Get("to").MustString(),
From: settings.Get("from").MustString(),
log: log.New("alerting.notification.email"), log: log.New("alerting.notification.email"),
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment