-
Notifications
You must be signed in to change notification settings - Fork 30k
[FW][FIX] mail: normalized when formatting email_to / email_cc #190504
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
Closed
fw-bot
wants to merge
2
commits into
odoo:saas-17.2
from
odoo-dev:saas-17.2-16.0-mail-validation-tde-dcw5-fw
Closed
[FW][FIX] mail: normalized when formatting email_to / email_cc #190504
fw-bot
wants to merge
2
commits into
odoo:saas-17.2
from
odoo-dev:saas-17.2-16.0-mail-validation-tde-dcw5-fw
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
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 |
@tde-banana-odoo the next pull request (#190531) is in conflict. You can merge the chain up to here by saying
More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port |
@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>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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