This is the main dovel repository, it has the Go code to run dovel SMTP server.
Author: bryon (git@mail.blmayer.dev)
Date: Sat Jul 22 13:25:36 2023 -0300
Parent: 1c8af10
Added one more template layer
commit bf0d46fa6e6f188bcebb4d24b0912e151d2c77e1
Author: bryon <git@mail.blmayer.dev>
Date: Sat Jul 22 13:25:36 2023 -0300
Added one more template layer
diff --git a/model/html/html.go b/model/html/html.go
index eb99598..d145bab 100644
--- a/model/html/html.go
+++ b/model/html/html.go
@@ -38,7 +38,7 @@ type HTMLHandler struct {
privateKey string
indexTpl *template.Template
listTpl *template.Template
- mailsTpl *template.Template
+ mailsTpl *template.Template
mailTpl *template.Template
}
@@ -158,7 +158,7 @@ func (h HTMLHandler) Save(from, to string, r io.Reader) error {
}
var threads []struct {
- Title string
+ Title string
LastMod time.Time
}
for _, d := range dir {
@@ -172,7 +172,7 @@ func (h HTMLHandler) Save(from, to string, r io.Reader) error {
continue
}
t := struct {
- Title string
+ Title string
LastMod time.Time
}{
Title: d.Name(),
@@ -192,7 +192,7 @@ func (h HTMLHandler) Save(from, to string, r io.Reader) error {
if err != nil {
return err
}
- err = h.indexTpl.Execute(file, payload)
+ err = h.indexTpl.Execute(file, threads)
if err != nil {
return err
}
@@ -205,7 +205,7 @@ func (h HTMLHandler) Save(from, to string, r io.Reader) error {
}
threads = []struct {
- Title string
+ Title string
LastMod time.Time
}{}
for _, d := range dir {
@@ -219,7 +219,7 @@ func (h HTMLHandler) Save(from, to string, r io.Reader) error {
continue
}
t := struct {
- Title string
+ Title string
LastMod time.Time
}{
Title: d.Name(),
@@ -239,10 +239,9 @@ func (h HTMLHandler) Save(from, to string, r io.Reader) error {
if err != nil {
return err
}
- err = h.listTpl.Execute(file, payload)
+ err = h.listTpl.Execute(file, threads)
if err != nil {
return err
}
return file.Close()
}
-