Skip to content

Commit

Permalink
Fix template
Browse files Browse the repository at this point in the history
  • Loading branch information
ahobsonsayers committed Sep 18, 2024
1 parent d62e88d commit d2b0acf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion twickets/notification/notification.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var (

func init() {
var err error
messageTemplate, err = template.ParseFS(messageTemplateFS, "message.tmpl.md")
messageTemplate, err = template.ParseFS(messageTemplateFS, "template/message.tmpl.md")
if err != nil {
log.Fatalf("failed to read notification message template: %v", err)
}
Expand Down
13 changes: 7 additions & 6 deletions twickets/notification/template/message.tmpl.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
Num Tickets: {{ .NumTickets }} ticket(s)
Ticket Price: {{ .TotalTicketPrice }}
Total Price: {{ .TotalPrice }}
{{ if lt .Discount 0.0 }}
{{ if lt .Discount 0.0 -}}
Discount: None
{{ else }}
Discount: {{ .Discount }}%
{{ end }}
{{- else -}}
Discount: {{ printf "%.2f" .Discount }}%
{{- end }}

Original Ticket Price: {{ .OriginalTicketPrice }}
Original Total Price: {{ .OriginalTotalPrice }}
{{ if .Link != "" }}

{{ if ne .Link "" -}}
Buy: {{ .Link }}
{{ end }}
{{- end }}

0 comments on commit d2b0acf

Please sign in to comment.