Skip to content

[18.0][FIX] mail_debrand: debrand chatter copy of template emails - #374

Open
LoisRForgeFlow wants to merge 1 commit into
OCA:18.0from
ForgeFlow:18.0-fix-mail_debrand-chatter-copy
Open

LoisRForgeFlow wants to merge 1 commit into
OCA:18.0from
ForgeFlow:18.0-fix-mail_debrand-chatter-copy

Conversation

@LoisRForgeFlow

@LoisRForgeFlow LoisRForgeFlow commented Dec 2, 2026 •

Copy link
Copy Markdown

mail.template.send_mail() with an email layout logs the whole rendered email, layout included, as the message body. Outgoing emails were debranded, but that chatter copy kept the "Powered by Odoo" footer, so it did not match what the recipient got. Debrand the logged body when it is the rendered email itself, as user content is not at stake.

Steps to reproduce, with mail_debrand and survey installed:

  1. Create a certification survey with a certification email template, and pass it as a participant (not as a test entry).
  2. Open the chatter of the participation (survey.user_input).
  3. The logged copy of the certification email shows "Powered by Odoo", while the email received has no such footer.

The same happens with every send_mail() call that passes an email_layout_xmlid (e.g. website_slides share emails, loyalty milestone emails) or uses a template with a layout set.

The fix only applies when body and body_html are identical at mail.mail creation, which is what send_mail() does with a layout. Notification emails (message_post) do not pass a body, and user-written content keeps the existing protection.

Complementary to #261, which handles plain-text brand mentions.

mail.template.send_mail() with an email layout logs the whole rendered
email, layout included, as the message body. Outgoing emails were
debranded, but that chatter copy kept the "Powered by Odoo" footer,
so it did not match what the recipient got. Debrand the logged body
when it is the rendered email itself, as user content is not at stake.
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Hi @joao-p-marques, @pedrobaeza,
some modules you are maintaining are being modified, check this out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants