Add hierarchical naming for templates
This commit is contained in:
parent
ce74f8363b
commit
ce15d774d6
|
@ -29,19 +29,19 @@ var (
|
|||
ColorResolved: "good",
|
||||
|
||||
Templates: SlackTemplates{
|
||||
Title: "slack_default_title",
|
||||
TitleLink: "slack_default_title_link",
|
||||
Pretext: "slack_default_pretext",
|
||||
Text: "slack_default_text",
|
||||
Fallback: "slack_default_fallback",
|
||||
Title: "slack.default.title",
|
||||
TitleLink: "slack.default.title_link",
|
||||
Pretext: "slack.default.pretext",
|
||||
Text: "slack.default.text",
|
||||
Fallback: "slack.default.fallback",
|
||||
},
|
||||
}
|
||||
|
||||
DefaultEmailConfig = EmailConfig{
|
||||
Templates: EmailTemplates{
|
||||
Header: "email_default_header",
|
||||
HTML: "email_default_html",
|
||||
Plain: "email_default_plain",
|
||||
Header: "email.default.header",
|
||||
HTML: "email.default.html",
|
||||
Plain: "email.default.plain",
|
||||
},
|
||||
}
|
||||
)
|
||||
|
|
|
@ -1,38 +1,38 @@
|
|||
{{ define "slack_default_fallback" }}
|
||||
{{ define "slack.default.fallback" }}
|
||||
fallback
|
||||
{{ end }}
|
||||
|
||||
{{ define "slack_default_pretext" }}
|
||||
{{ define "slack.default.pretext" }}
|
||||
pre text
|
||||
{{ end }}
|
||||
|
||||
{{ define "slack_default_title" }}
|
||||
{{ define "slack.default.title" }}
|
||||
Title
|
||||
{{ end }}
|
||||
|
||||
{{ define "slack_default_titlelink" }}
|
||||
{{ define "slack.default.titlelink" }}
|
||||
http://localhost:9090
|
||||
{{ end }}
|
||||
|
||||
{{ define "slack_default_text" }}
|
||||
{{ define "slack.default.text" }}
|
||||
my text
|
||||
my text
|
||||
my text
|
||||
{{ end }}
|
||||
|
||||
{{ define "email_default_header" }}From: "Prometheus Alertmanager" <{{ .From }}>
|
||||
{{ define "email.default.header" }}From: "Prometheus Alertmanager" <{{ .From }}>
|
||||
To: {{ .To }}
|
||||
Date: {{ .Date }}
|
||||
Subject: [{{ .Alerts.Status }}]
|
||||
{{ end }}
|
||||
|
||||
{{ define "email_default_plain" }}
|
||||
{{ define "email.default.plain" }}
|
||||
{{ range .Alerts }}
|
||||
{{ .String }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "email_default_html" }}
|
||||
{{ define "email.default.html" }}
|
||||
{{ range .Alerts }}
|
||||
{{ .String }}
|
||||
{{ end }}
|
||||
|
|
Loading…
Reference in New Issue