Skip to content

Commit

Permalink
Merge pull request #28 from umomany/master
Browse files Browse the repository at this point in the history
add extra template function "Contains"
  • Loading branch information
mr-karan authored Jun 1, 2021
2 parents 078cfb4 + 3288fc0 commit 3508c02
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ func sendMessageToChat(alerts []alerttemplate.Alert, notif *Notifier, webHookURL
)
// common funcs used in template
templateFuncMap := template.FuncMap{
"Title": strings.Title,
"toUpper": strings.ToUpper,
"Title": strings.Title,
"toUpper": strings.ToUpper,
"Contains": strings.Contains,
}
// read template file
tmpl, err := template.New("message.tmpl").Funcs(templateFuncMap).ParseFiles(viper.GetString("app.template_file"))
Expand Down

0 comments on commit 3508c02

Please sign in to comment.