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.
This commit is contained in:
Tink bot
2026-05-18 18:15:20 +00:00
committed by kolaente
parent faeeebe661
commit fee2d2ea58
2 changed files with 7 additions and 2 deletions

View File

@@ -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

View File

@@ -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")