diff --git a/init.go b/init.go index 769a579..699f30c 100644 --- a/init.go +++ b/init.go @@ -50,8 +50,10 @@ func initFS() stuffbin.FileSystem { "config.toml.sample", "queries.sql", "schema.sql", - "email-templates", - "public", + "static/email-templates", + + // Alias /static/public to /public for the HTTP fileserver. + "static/public:/public", // The frontend app's static assets are aliased to /frontend // so that they are accessible at localhost:port/frontend/static/ ... @@ -261,7 +263,7 @@ func initNotifTemplates(path string, fs stuffbin.FileSystem, cs *constants) *tem return cs.LogoURL }} - tpl, err := stuffbin.ParseTemplatesGlob(funcs, fs, "/email-templates/*.html") + tpl, err := stuffbin.ParseTemplatesGlob(funcs, fs, "/static/email-templates/*.html") if err != nil { lo.Fatalf("error parsing e-mail notif templates: %v", err) } diff --git a/email-templates/base.html b/static/email-templates/base.html similarity index 100% rename from email-templates/base.html rename to static/email-templates/base.html diff --git a/email-templates/campaign-status.html b/static/email-templates/campaign-status.html similarity index 100% rename from email-templates/campaign-status.html rename to static/email-templates/campaign-status.html diff --git a/email-templates/default.tpl b/static/email-templates/default.tpl similarity index 100% rename from email-templates/default.tpl rename to static/email-templates/default.tpl diff --git a/email-templates/import-status.html b/static/email-templates/import-status.html similarity index 100% rename from email-templates/import-status.html rename to static/email-templates/import-status.html diff --git a/email-templates/subscriber-data.html b/static/email-templates/subscriber-data.html similarity index 100% rename from email-templates/subscriber-data.html rename to static/email-templates/subscriber-data.html diff --git a/email-templates/subscriber-optin-campaign.html b/static/email-templates/subscriber-optin-campaign.html similarity index 100% rename from email-templates/subscriber-optin-campaign.html rename to static/email-templates/subscriber-optin-campaign.html diff --git a/email-templates/subscriber-optin.html b/static/email-templates/subscriber-optin.html similarity index 100% rename from email-templates/subscriber-optin.html rename to static/email-templates/subscriber-optin.html diff --git a/static/public/base.html b/static/public/base.html new file mode 100644 index 0000000..0f47897 --- /dev/null +++ b/static/public/base.html @@ -0,0 +1,98 @@ +{{ define "header" }} + + +
+ + +Campaign | +{{ index . "Name" }} | +
Status | +{{ index . "Status" }} | +
Sent | +{{ index . "Sent" }} / {{ index . "ToSend" }} | +
Reason | +{{ index . "Reason" }} | +
File | +{{ .Name }} | +
Status | +{{ .Status }} | +
Records | +{{ .Imported }} / {{ .Total }} | +
+ A copy of all data recorded on you is attached as a file in the JSON format. + It can be viewed in a text editor. +
+{{ template "footer" }} +{{ end }} diff --git a/static/public/subscriber-optin-campaign.html b/static/public/subscriber-optin-campaign.html new file mode 100644 index 0000000..fbdaab6 --- /dev/null +++ b/static/public/subscriber-optin-campaign.html @@ -0,0 +1,17 @@ +{{ define "optin-campaign" }} + +Hi {{`{{ .Subscriber.FirstName }}`}},
+You have been added to the following mailing lists:
+Hi {{ .Subscriber.FirstName }},
+You have been added to the following mailing lists:
+Confirm your subscription by clicking the below button.
+ + +{{ template "footer" }} +{{ end }} diff --git a/public/templates/index.html b/static/public/templates/index.html similarity index 100% rename from public/templates/index.html rename to static/public/templates/index.html diff --git a/public/templates/message.html b/static/public/templates/message.html similarity index 100% rename from public/templates/message.html rename to static/public/templates/message.html diff --git a/public/templates/optin.html b/static/public/templates/optin.html similarity index 100% rename from public/templates/optin.html rename to static/public/templates/optin.html diff --git a/public/templates/subscription.html b/static/public/templates/subscription.html similarity index 100% rename from public/templates/subscription.html rename to static/public/templates/subscription.html