From 899f61b7d8516697ce614653803d1e068e8fab04 Mon Sep 17 00:00:00 2001 From: Kevin Midboe Date: Sat, 3 Dec 2022 12:28:47 +0100 Subject: [PATCH] Moved html template to root level folder & ignored it from git linguist --- .gitattributes | 1 + cmd/preview/main.go | 2 +- mail-templates/order-confirmation.html | 208 +++++++++++++++++++++ mail/mail-template_order-confirmation.html | 208 --------------------- mail/template.go | 2 +- 5 files changed, 211 insertions(+), 210 deletions(-) create mode 100644 .gitattributes create mode 100644 mail-templates/order-confirmation.html delete mode 100644 mail/mail-template_order-confirmation.html diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..7ae38df --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +mail-templates/* linguist-vendored \ No newline at end of file diff --git a/cmd/preview/main.go b/cmd/preview/main.go index 7e2c88f..cfdbe93 100644 --- a/cmd/preview/main.go +++ b/cmd/preview/main.go @@ -25,7 +25,7 @@ type ReceiptPageData struct { } func serveTemplate(response http.ResponseWriter, request *http.Request) { - tmpl := template.Must(template.ParseFiles("mail/mail-template_order-confirmation.html")) + tmpl := template.Must(template.ParseFiles("mail-templates/order-confirmation.html")) // tmpl := template.Must(w) data := ReceiptPageData{ PageTitle: "Planetposen purchase", diff --git a/mail-templates/order-confirmation.html b/mail-templates/order-confirmation.html new file mode 100644 index 0000000..53fc0bb --- /dev/null +++ b/mail-templates/order-confirmation.html @@ -0,0 +1,208 @@ + + + + + + + {{.PageTitle}} + + + + + + + + + + + + + + + + + + + + + +
+

{{.PageTitle}}

+ + + + + + + + + +
+ + + diff --git a/mail/mail-template_order-confirmation.html b/mail/mail-template_order-confirmation.html deleted file mode 100644 index 1a9ba5f..0000000 --- a/mail/mail-template_order-confirmation.html +++ /dev/null @@ -1,208 +0,0 @@ - - - - - - - {{.PageTitle}} - - - - - - - - - - - - - - - - - - - - - -
-

{{.PageTitle}}

- - - - - - - - - -
- - - diff --git a/mail/template.go b/mail/template.go index 2e83c8a..e68bef4 100644 --- a/mail/template.go +++ b/mail/template.go @@ -14,7 +14,7 @@ func buildOrderConfirmation(templateData EmailTemplateData) *OrderConfirmationEm FromEmail: "noreply@kevm.dev", } - tmpl := template.Must(template.ParseFiles("mail/mail-template_order-confirmation.html")) + tmpl := template.Must(template.ParseFiles("mail-templates/order-confirmation.html")) b := new(strings.Builder) err := tmpl.Execute(b, templateData) if err != nil {