-
-
-
-
-
-
- 
-
- Hi {{.RecipientHandle}},
-
- You have {{.Count}} new notification{{if gt .Count 1}}s{{end}}:
-
-
- {{range .Groups}}
-
-
-
-
-
-
-
- |
-
- {{.HeaderHTML}}
- {{if .EntityRef}}{{.EntityRef}} {{end}}
- |
-
-
-
- |
-
- {{end}}
-
- {{if .HasMore}}
-
- View more notifications
-
- {{end}}
-
- |
-
-
+const digestBodyHTMLTmpl = `Hi {{.RecipientHandle}},
+
+ You have {{.Count}} new notification{{if gt .Count 1}}s{{end}}:
+
+
+ {{range .Groups}}
+
+
+
+
+
+
+
+ |
+
+ {{.HeaderHTML}}
+ {{if .EntityRef}}{{.EntityRef}} {{end}}
+ |
+
- |
-
-
+
+
+
+ {{end}}
-
-`
+{{if .HasMore}}
+
+ View more notifications
+
+{{end}}
+
+ Manage notification settings
+ `
const digestMaxGroups = 10
@@ -123,7 +83,6 @@
HasMore bool
NotificationsURL string
SettingsURL string
- AssetsURL string
}
func notifHeader(n *models.Notification, actor, repo string) string {
@@ -225,7 +184,7 @@
batchWait: batchWait,
interval: interval,
textTmpl: gotemplate.Must(gotemplate.New("digest-text").Funcs(gotemplate.FuncMap{"wrap": wordwrap}).Parse(digestTextTmpl)),
- htmlTmpl: template.Must(template.New("digest-html").Parse(digestHTMLTmpl)),
+ htmlTmpl: template.Must(template.New("digest-body").Parse(digestBodyHTMLTmpl)),
}
}
@@ -347,7 +306,6 @@
HasMore: count > digestMaxGroups,
NotificationsURL: d.baseURL + "/notifications",
SettingsURL: d.baseURL + "/settings/notifications",
- AssetsURL: d.assetsURL,
}
if count > digestMaxGroups {
@@ -366,6 +324,6 @@
if err = d.htmlTmpl.Execute(&htmlBuf, data); err != nil {
return
}
- html = htmlBuf.String()
+ html = emailtemplate.Shell("Tangled notifications", htmlBuf.String(), d.baseURL)
return
}
diff --git a/deliberi/emailtemplate/template.go b/deliberi/emailtemplate/template.go
new file mode 100644
--- /dev/null
+++ b/deliberi/emailtemplate/template.go
@@ -0,0 +1,51 @@
+// Package emailtemplate is the branded HTML shell shared by every deliberi email.
+package emailtemplate
+
+import "strings"
+
+// Shell wraps title and bodyHTML in the Tangled-branded email document. The
+// logo is served by the web app at /logos/dolly.png (web/static/logos).
+func Shell(title, bodyHTML, baseURL string) string {
+ return `
+
+
+
+
+` + title + `
+
+
+
+
+
+
+
+
+
+
+
+ 
+
+` + bodyHTML + `
+
+
+
+ |
+ Tangled Labs Oy. © 2026 All rights reserved.
+
+ tangled.org
+
+ |
+
+
+
+ |
+
+
+
+ |
+
+
+
+
+`
+}
|