Skip to content

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

Fix attachments incorrectly accuring for every recipient in test mails. Closes #2949.

Kailash Nadh5f4f360d5fc0
diff --git a/internal/manager/manager.go b/internal/manager/manager.go
index 552f6be9..3ff32fa4 100644
--- a/internal/manager/manager.go
+++ b/internal/manager/manager.go
@@ -662,6 +662,10 @@ func (m *Manager) makeGnericFuncMap() template.FuncMap {
// attachMedia loads any media/attachments from the media store and attaches
// the byte blobs to the campaign.
func (m *Manager) attachMedia(c *models.Campaign) error {
+ if len(c.Attachments) > 0 {
+ return nil
+ }
+
// Load any media/attachments.
for _, mid := range []int64(c.MediaIDs) {
a, err := m.store.GetAttachment(int(mid))