Skip to content

Commit

Permalink
add extra template function "Contains" LIT-406071
Browse files Browse the repository at this point in the history
  • Loading branch information
umomany committed Jun 1, 2021
1 parent 078cfb4 commit 3288fc0
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 3288fc0

Please sign in to comment.