mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-05-22 02:30:56 -05:00
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:
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user