Skip to content

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Dec 12, 2024

When preparing final outgoing email, partner email is normalized. We take their formatted email, which is their name and their normalized email. However email_to and email_cc are taken from input using 'email_split(_and_format)', which finds emails but do not format them.

This leads to incoherent behavior as most emails are normalized as we generally always use partners, but not all. In this commit we now split, normalize and format email_to and email_cc in outgoing emails.

This fixes a first issue where name are lost if a formatted email was entered in email_cc field. Only address was kept, now the name is correctly found and put back.

This also fixes an issue for validated email detection, in order to compare normalized emails. This was introduced at #185793 and may skip valid emails entered in email_to or email_cc.

This commit backports a tool introduced at dd4709e which aims at allowing a quick convert from a string holding emails to a list of nicely formatted emails, using normalize version of email addresses. This is the standard we use in most flows.

Task-4376876
Followup of task-3704658

Forward-Port-Of: #190033
Forward-Port-Of: #189409

When preparing final outgoing email, partner email is normalized. We
take their formatted email, which is their name and their normalized
email. However email_to and email_cc are taken from input using
'email_split(_and_format)', which finds emails but do not format them.

This leads to incoherent behavior as most emails are normalized as
we generally always use partners, but not all. In this commit we now
split, normalize and format email_to and email_cc in outgoing emails.

This fixes a first issue where name are lost if a formatted email was
entered in email_cc field. Only address was kept, now the name is
correctly found and put back.

This also fixes an issue for validated email detection, in order to
compare normalized emails. This was introduced at odoo#185793
and may skip valid emails entered in email_to or email_cc.

This commit backports a tool introduced at odoo/odoo@dd4709e which
aims at allowing a quick convert from a string holding emails to a list
of nicely formatted emails, using normalize version of email addresses.
This is the standard we use in most flows.

Task-4376876
Followup of task-3704658

X-original-commit: 767164d
Due to history reasons, input given when inviting users is parsed in a
simple way. However this create issues, notably because Odoo heavily
relies on normalized emails.

We therefore use the same heuristics as when creating partners given
a potentially formatted input.

Task-4376876
Followup of task-3704658

X-original-commit: bc7d5d2
@robodoo
Copy link
Contributor

robodoo commented Dec 12, 2024

Pull request status dashboard

@fw-bot
Copy link
Contributor Author

fw-bot commented Dec 12, 2024

This PR targets saas-17.2 and is part of the forward-port chain. Further PRs will be created up to master.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@robodoo robodoo added the forwardport This PR was created by @fw-bot label Dec 12, 2024
@C3POdoo C3POdoo added the RD research & development, internal work label Dec 12, 2024
@fw-bot
Copy link
Contributor Author

fw-bot commented Dec 12, 2024

@tde-banana-odoo the next pull request (#190531) is in conflict. You can merge the chain up to here by saying

@robodoo r+

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@tde-banana-odoo
Copy link
Contributor

@robodoo r+

robodoo pushed a commit that referenced this pull request Dec 12, 2024
When preparing final outgoing email, partner email is normalized. We
take their formatted email, which is their name and their normalized
email. However email_to and email_cc are taken from input using
'email_split(_and_format)', which finds emails but do not format them.

This leads to incoherent behavior as most emails are normalized as
we generally always use partners, but not all. In this commit we now
split, normalize and format email_to and email_cc in outgoing emails.

This fixes a first issue where name are lost if a formatted email was
entered in email_cc field. Only address was kept, now the name is
correctly found and put back.

This also fixes an issue for validated email detection, in order to
compare normalized emails. This was introduced at #185793
and may skip valid emails entered in email_to or email_cc.

This commit backports a tool introduced at dd4709e which
aims at allowing a quick convert from a string holding emails to a list
of nicely formatted emails, using normalize version of email addresses.
This is the standard we use in most flows.

Task-4376876
Followup of task-3704658

X-original-commit: 767164d
Part-of: #190504
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
robodoo pushed a commit that referenced this pull request Dec 12, 2024
Due to history reasons, input given when inviting users is parsed in a
simple way. However this create issues, notably because Odoo heavily
relies on normalized emails.

We therefore use the same heuristics as when creating partners given
a potentially formatted input.

Task-4376876
Followup of task-3704658

closes #190504

X-original-commit: bc7d5d2
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
@robodoo robodoo closed this Dec 12, 2024
@fw-bot fw-bot deleted the saas-17.2-16.0-mail-validation-tde-dcw5-fw branch December 26, 2024 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

forwardport This PR was created by @fw-bot RD research & development, internal work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants