Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BCC will not Propperly be Sent #1591

Closed
agent-z28 opened this issue Feb 12, 2025 · 1 comment · Fixed by #1592
Closed

BCC will not Propperly be Sent #1591

agent-z28 opened this issue Feb 12, 2025 · 1 comment · Fixed by #1592

Comments

@agent-z28
Copy link
Contributor

https://github.com/OCA/social/blob/16.0/mail_composer_cc_bcc/models/mail_mail.py#L298

the super function is called before:

Image

so the "email_to_normalized" will not contain the bcc and cc addresses.

Image

but here they will be removed since they are not in the validated_to

Image

@agent-z28
Copy link
Contributor Author

agent-z28 commented Feb 12, 2025

@trisdoan can you please validate my point ?

this could be a fix:

def _send_prepare_values(self, partner=None):
res = super()._send_prepare_values(partner=partner)
is_from_composer = self.env.context.get("is_from_composer", False)
if not is_from_composer:
return res
partners_cc_bcc = self.recipient_cc_ids + self.recipient_bcc_ids
partner_to_ids = [r.id for r in self.recipient_ids if r not in partners_cc_bcc]
partner_to = self.env["res.partner"].browse(partner_to_ids)
res["email_to"] = format_emails(partner_to)
res["email_cc"] = format_emails(self.recipient_cc_ids)
res["email_bcc"] = format_emails(self.recipient_bcc_ids)
if res.get("email_to"):
res["email_to_normalized"] += tools.email_normalize_all(res["email_to"])
if res.get("email_cc"):
res["email_to_normalized"] += tools.email_normalize_all(res["email_cc"])
if res.get("email_bcc"):
res["email_to_normalized"] += tools.email_normalize_all(res["email_bcc"])
return res

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant