Skip to content

High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.

fix: improve tracking pixel HTML attributes (#3136)

shustovTE18b7459d7bba
diff --git a/cmd/public.go b/cmd/public.go
index b81e51ba..01f70170 100644
--- a/cmd/public.go
+++ b/cmd/public.go
@@ -99,7 +99,9 @@ type subFormTpl struct {
}
var (
- pixelPNG = drawTransparentImage(3, 14)
+ // pixelPNG is a 1x1 transparent PNG served as the tracking pixel.
+ // Using the canonical 1x1 size (industry standard for tracking pixels).
+ pixelPNG = drawTransparentImage(1, 1)
)
// Render executes and renders a template for echo.
diff --git a/internal/manager/manager.go b/internal/manager/manager.go
index 643187b1..8b7c304e 100644
--- a/internal/manager/manager.go
+++ b/internal/manager/manager.go
@@ -392,7 +392,9 @@ func (m *Manager) TemplateFuncs(c *models.Campaign) template.FuncMap {
subUUID = dummyUUID
}
- return template.HTML(fmt.Sprintf(`<img src="%s" alt="" />`,
+ // Use a 1x1 invisible tracking pixel with explicit dimensions and CSS
+ // visibility properties for better anti-spam filter compatibility.
+ return template.HTML(fmt.Sprintf(`<img src="%s" width="1" height="1" style="display:none;max-height:0;max-width:0;opacity:0" alt="">`,
fmt.Sprintf(m.cfg.ViewTrackURL, msg.Campaign.UUID, subUUID)))
},
"UnsubscribeURL": func(msg *CampaignMessage) string {