Improved the default templates
This commit is contained in:
parent
676454972c
commit
8c427cc571
1 changed files with 19 additions and 16 deletions
33
template.go
33
template.go
|
@ -7,23 +7,26 @@ import (
|
||||||
"text/template"
|
"text/template"
|
||||||
)
|
)
|
||||||
|
|
||||||
const DEFAULT_SUBJECT_TEMPLATE = "{{ if .Status }}{{.Status}} {{ end }}[{{.Classification}}] {{.Title}}"
|
const DEFAULT_SUBJECT_TEMPLATE = "[{{ .Classification }}] {{ .Title }}"
|
||||||
const DEFAULT_BODY_TEMPLATE = `{{.Name}}
|
const DEFAULT_BODY_TEMPLATE = `{{ if .Status }}[{{ .Status }}] {{ end }}{{ .Name }}
|
||||||
{{.PortalUrl}}
|
-> {{ .PortalUrl }}
|
||||||
|
{{- if eq .NoPatch "true" }}
|
||||||
|
|
||||||
|
No patch available!
|
||||||
|
{{- end }}
|
||||||
|
{{ if gt .Basescore -1 }}
|
||||||
|
Basescore: {{ .Basescore }}{{- end }}
|
||||||
Published: {{ .Published }}
|
Published: {{ .Published }}
|
||||||
{{ if gt .Basescore -1 }}Basescore: {{.Basescore}}
|
{{- if .ProductNames }}
|
||||||
{{ end -}}
|
|
||||||
{{ if eq .NoPatch "true" }}There is no patch available at the moment!
|
Affected Products:{{ range $product := .ProductNames }}
|
||||||
{{ end }}
|
- {{ $product }}
|
||||||
Affected Products:
|
{{- end }}{{ end }}
|
||||||
{{ range $product := .ProductNames }} - {{ $product }}
|
{{- if .Cves }}
|
||||||
{{ else }} unknown
|
|
||||||
{{ end }}
|
Assigned CVEs:{{ range $cve := .Cves }}
|
||||||
Assigned CVEs:
|
- {{ $cve }} -> https://www.cve.org/CVERecord?id={{ $cve }}
|
||||||
{{ range $cve := .Cves }} - {{ $cve }}
|
{{- end }}{{ end }}`
|
||||||
{{ else }} unknown
|
|
||||||
{{ end }}`
|
|
||||||
|
|
||||||
type MailTemplateConfig struct {
|
type MailTemplateConfig struct {
|
||||||
SubjectTemplate string `json:"subject"`
|
SubjectTemplate string `json:"subject"`
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue