Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
4d03e041
Commit
4d03e041
authored
Jun 16, 2016
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(alerting): enable email notifiter
parent
2e809cae
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
pkg/services/alerting/notifier.go
+6
-7
No files found.
pkg/services/alerting/notifier.go
View file @
4d03e041
...
@@ -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"
),
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment