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
f185c2c9
Commit
f185c2c9
authored
Mar 03, 2017
by
Carl Bergquist
Committed by
GitHub
Mar 03, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7676 from dbrgn/threema-emoji
feat(alerting): Add emoji to Threema alert notifications
parents
55e0df78
1422655e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
pkg/services/alerting/notifiers/threema.go
+14
-2
No files found.
pkg/services/alerting/notifiers/threema.go
View file @
f185c2c9
...
@@ -126,9 +126,21 @@ func (notifier *ThreemaNotifier) Notify(evalContext *alerting.EvalContext) error
...
@@ -126,9 +126,21 @@ func (notifier *ThreemaNotifier) Notify(evalContext *alerting.EvalContext) error
data
.
Set
(
"to"
,
notifier
.
RecipientID
)
data
.
Set
(
"to"
,
notifier
.
RecipientID
)
data
.
Set
(
"secret"
,
notifier
.
APISecret
)
data
.
Set
(
"secret"
,
notifier
.
APISecret
)
// Determine emoji
stateEmoji
:=
""
switch
evalContext
.
Rule
.
State
{
case
m
.
AlertStateOK
:
stateEmoji
=
"
\u2705
"
// White Heavy Check Mark
case
m
.
AlertStateNoData
:
stateEmoji
=
"
\u2753
"
// Black Question Mark Ornament
case
m
.
AlertStateAlerting
:
stateEmoji
=
"
\u26A0
"
// Warning sign
}
// Build message
// Build message
message
:=
fmt
.
Sprintf
(
"%s
\n\n
*State:* %s
\n
*Message:* %s
\n
"
,
message
:=
fmt
.
Sprintf
(
"%s%s
\n\n
*State:* %s
\n
*Message:* %s
\n
"
,
evalContext
.
GetNotificationTitle
(),
evalContext
.
Rule
.
Name
,
evalContext
.
Rule
.
Message
)
stateEmoji
,
evalContext
.
GetNotificationTitle
(),
evalContext
.
Rule
.
Name
,
evalContext
.
Rule
.
Message
)
ruleURL
,
err
:=
evalContext
.
GetRuleUrl
()
ruleURL
,
err
:=
evalContext
.
GetRuleUrl
()
if
err
==
nil
{
if
err
==
nil
{
message
=
message
+
fmt
.
Sprintf
(
"*URL:* %s
\n
"
,
ruleURL
)
message
=
message
+
fmt
.
Sprintf
(
"*URL:* %s
\n
"
,
ruleURL
)
...
...
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