From fee2d2ea58b9452ee8323f215de8d17366687d06 Mon Sep 17 00:00:00 2001 From: Tink bot Date: Mon, 18 May 2026 18:15:20 +0000 Subject: [PATCH] fix(notifications): skip logo attachment for conversational mails The conversational mail template does not reference cid:logo.png, but RenderMail still attached the embedded logo to every outgoing mail. That left an orphan inline part that some clients render as a stray attachment. Only embed logo.png when the formal template is in use. --- pkg/notifications/mail_render.go | 7 +++++-- pkg/notifications/mail_test.go | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/notifications/mail_render.go b/pkg/notifications/mail_render.go index 67b254d35..292927c80 100644 --- a/pkg/notifications/mail_render.go +++ b/pkg/notifications/mail_render.go @@ -407,9 +407,12 @@ func RenderMail(m *Mail, lang string) (mailOpts *mail.Opts, err error) { HTMLMessage: htmlContent.String(), Boundary: boundary, ThreadID: m.threadID, - EmbedFS: map[string]*embed.FS{ + } + + if !m.conversational { + mailOpts.EmbedFS = map[string]*embed.FS{ "logo.png": &logo, - }, + } } return mailOpts, nil diff --git a/pkg/notifications/mail_test.go b/pkg/notifications/mail_test.go index 125a13cd0..fca5c6447 100644 --- a/pkg/notifications/mail_test.go +++ b/pkg/notifications/mail_test.go @@ -533,6 +533,7 @@ func TestConversationalMail(t *testing.T) { // Should NOT have logo (completely removed) assert.NotContains(t, mailopts.HTMLMessage, "logo.png") assert.NotContains(t, mailopts.HTMLMessage, "Vikunja") + assert.NotContains(t, mailopts.EmbedFS, "logo.png") // Should have inline action link with arrow assert.Contains(t, mailopts.HTMLMessage, "View Task →") @@ -571,6 +572,7 @@ func TestConversationalMail(t *testing.T) { // Should HAVE logo in formal emails assert.Contains(t, mailopts.HTMLMessage, "logo.png") assert.Contains(t, mailopts.HTMLMessage, "Vikunja") + assert.Contains(t, mailopts.EmbedFS, "logo.png") // Should have formal button styling assert.Contains(t, mailopts.HTMLMessage, "background-color: #1973ff")