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
fc146fe5
Commit
fc146fe5
authored
May 17, 2017
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:grafana/grafana
parents
8e03f321
9dc220b8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
1 deletions
+54
-1
emails/templates/alert_notification.html
+23
-0
pkg/services/alerting/notifiers/email.go
+6
-0
pkg/services/alerting/test_notification.go
+2
-1
public/emails/alert_notification.html
+23
-0
No files found.
emails/templates/alert_notification.html
View file @
fc146fe5
...
...
@@ -28,6 +28,29 @@
</tr>
</table>
[[if ne .Error "" ]]
<table
class=
"row"
>
<tr>
<td
class=
"last"
>
<center>
<table
class=
"twelve columns"
>
<tr>
<td
class=
"twelve last"
>
<h5
style=
"font-weight: bold;"
>
Error message
</h5>
</td>
</tr>
<tr>
<td
class=
"twelve last"
>
<p>
[[.Error]]
</p>
</td>
</tr>
</table>
</center>
</td>
</tr>
</table>
[[end]]
[[if ne .State "ok" ]]
<table
class=
"row"
>
<tr>
...
...
pkg/services/alerting/notifiers/email.go
View file @
fc146fe5
...
...
@@ -69,6 +69,11 @@ func (this *EmailNotifier) Notify(evalContext *alerting.EvalContext) error {
return
err
}
error
:=
""
if
evalContext
.
Error
!=
nil
{
error
=
evalContext
.
Error
.
Error
()
}
cmd
:=
&
m
.
SendEmailCommandSync
{
SendEmailCommand
:
m
.
SendEmailCommand
{
Subject
:
evalContext
.
GetNotificationTitle
(),
...
...
@@ -78,6 +83,7 @@ func (this *EmailNotifier) Notify(evalContext *alerting.EvalContext) error {
"Name"
:
evalContext
.
Rule
.
Name
,
"StateModel"
:
evalContext
.
GetStateModel
(),
"Message"
:
evalContext
.
Rule
.
Message
,
"Error"
:
error
,
"RuleUrl"
:
ruleUrl
,
"ImageLink"
:
""
,
"EmbededImage"
:
""
,
...
...
pkg/services/alerting/test_notification.go
View file @
fc146fe5
...
...
@@ -2,6 +2,7 @@ package alerting
import
(
"context"
"fmt"
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/components/null"
...
...
@@ -56,7 +57,7 @@ func createTestEvalContext(cmd *NotificationTestCommand) *EvalContext {
}
ctx
.
IsTestRun
=
true
ctx
.
Firing
=
true
ctx
.
Error
=
nil
ctx
.
Error
=
fmt
.
Errorf
(
"This is only a test"
)
ctx
.
EvalMatches
=
evalMatchesBasedOnState
()
return
ctx
...
...
public/emails/alert_notification.html
View file @
fc146fe5
...
...
@@ -234,6 +234,29 @@ text-decoration: underline;
</tr>
</table>
{{if ne .Error "" }}
<table
class=
"row"
style=
"border-spacing: 0; border-collapse: collapse; vertical-align: top; text-align: left; width: 100%; position: relative; display: block; padding: 0px;"
>
<tr
style=
"vertical-align: top; padding: 0;"
align=
"left"
>
<td
class=
"last"
style=
"word-break: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; color: #222222; font-family: 'Open Sans', 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-weight: normal; line-height: 19px; font-size: 14px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; margin: 0; padding: 0 0px 0 0;"
align=
"left"
valign=
"top"
>
<center
style=
"width: 100%; min-width: 580px;"
>
<table
class=
"twelve columns"
style=
"border-spacing: 0; border-collapse: collapse; vertical-align: top; text-align: left; width: 580px; margin: 0 auto; padding: 0;"
>
<tr
style=
"vertical-align: top; padding: 0;"
align=
"left"
>
<td
class=
"twelve last"
style=
"word-break: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; width: 100%; color: #222222; font-family: 'Open Sans', 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-weight: normal; line-height: 19px; font-size: 14px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; margin: 0; padding: 0px 0px 10px;"
align=
"left"
valign=
"top"
>
<h5
style=
"font-weight: bold; color: #222222; font-family: 'Open Sans', 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; line-height: 1.3; word-break: normal; font-size: 18px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; margin: 0; padding: 0;"
align=
"left"
>
Error message
</h5>
</td>
</tr>
<tr
style=
"vertical-align: top; padding: 0;"
align=
"left"
>
<td
class=
"twelve last"
style=
"word-break: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; width: 100%; color: #222222; font-family: 'Open Sans', 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-weight: normal; line-height: 19px; font-size: 14px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; margin: 0; padding: 0px 0px 10px;"
align=
"left"
valign=
"top"
>
<p
style=
"color: #222222; font-family: 'Open Sans', 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif; font-weight: normal; line-height: 19px; font-size: 14px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; margin: 0 0 10px; padding: 0;"
align=
"left"
>
{{.Error}}
</p>
</td>
</tr>
</table>
</center>
</td>
</tr>
</table>
{{end}}
{{if ne .State "ok" }}
<table
class=
"row"
style=
"border-spacing: 0; border-collapse: collapse; vertical-align: top; text-align: left; width: 100%; position: relative; display: block; padding: 0px;"
>
<tr
style=
"vertical-align: top; padding: 0;"
align=
"left"
>
...
...
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