[FW][FIX] mail: multi recipient duplication (16.0)#188426
Closed
fw-bot wants to merge 3 commits intoodoo:saas-17.2from
Closed
[FW][FIX] mail: multi recipient duplication (16.0)#188426fw-bot wants to merge 3 commits intoodoo:saas-17.2from
fw-bot wants to merge 3 commits intoodoo:saas-17.2from
Conversation
It is faster to check first if the emails are empty than to look them up inside the optout/done lists. But frankly this commit is only here to simplify the diff with the next commit. Task-3927361 X-original-commit: 849247a
Install mass-mailing and crm. Change the email address of Brandon to `a@example.com;b@example.com`. In the list view of crm, add the select all leads and change their customer to Brandon (the customer column is not displayed by default, just make it visible). Create a new mass- mailing with the recipient list as "Lead/Opportunity". Start the campaign. Brandon receives as many emails as there are leads but he shall only receive one. The system has a known limitation when it comes to filtering duplicates: it skips all records that have multiple recipients. In this case Brandon has two: a@example.com and b@example.com. The de-duplication mechanism was skipped for every lead he was the customer of and each time a new email was sent, spamming him. In this work we make it possible to also process records with multiple recipients. It is a best-effort and will still let some duplicates through. Nonetheless it solves the current problem with minimal changes. Note: `any([])` and `any([''])` are both False while `all([])` is True, hence we now check for empty list / empty email first otherwise an empty list would be considered to be opt-out instead of empty. Task-3927361 X-original-commit: ab3889d
The `_get_done_emails` and `_get_optout_emails` are returning normalized emails, hence we should compare the normalized email address of the recipient against those lists. Enforced the normalization, email normalisation is fast and idempotent, there is no problem (nor functional-wise, nor performance-wise) to re-normalize those emails. Task-3927361 X-original-commit: b272b51
Contributor
Contributor
Author
|
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
pushed a commit
that referenced
this pull request
Nov 28, 2024
It is faster to check first if the emails are empty than to look them up inside the optout/done lists. But frankly this commit is only here to simplify the diff with the next commit. Task-3927361 X-original-commit: 849247a Part-of: #188426 Signed-off-by: Julien Castiaux (juc) <juc@odoo.com> Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
robodoo
pushed a commit
that referenced
this pull request
Nov 28, 2024
Install mass-mailing and crm. Change the email address of Brandon to `a@example.com;b@example.com`. In the list view of crm, add the select all leads and change their customer to Brandon (the customer column is not displayed by default, just make it visible). Create a new mass- mailing with the recipient list as "Lead/Opportunity". Start the campaign. Brandon receives as many emails as there are leads but he shall only receive one. The system has a known limitation when it comes to filtering duplicates: it skips all records that have multiple recipients. In this case Brandon has two: a@example.com and b@example.com. The de-duplication mechanism was skipped for every lead he was the customer of and each time a new email was sent, spamming him. In this work we make it possible to also process records with multiple recipients. It is a best-effort and will still let some duplicates through. Nonetheless it solves the current problem with minimal changes. Note: `any([])` and `any([''])` are both False while `all([])` is True, hence we now check for empty list / empty email first otherwise an empty list would be considered to be opt-out instead of empty. Task-3927361 X-original-commit: ab3889d Part-of: #188426 Signed-off-by: Julien Castiaux (juc) <juc@odoo.com> Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
robodoo
pushed a commit
that referenced
this pull request
Nov 28, 2024
The `_get_done_emails` and `_get_optout_emails` are returning normalized emails, hence we should compare the normalized email address of the recipient against those lists. Enforced the normalization, email normalisation is fast and idempotent, there is no problem (nor functional-wise, nor performance-wise) to re-normalize those emails. Task-3927361 X-original-commit: b272b51 Part-of: #188426 Signed-off-by: Julien Castiaux (juc) <juc@odoo.com> Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
robodoo
added a commit
that referenced
this pull request
Nov 28, 2024
Install mass-mailing and crm. Change the email address of Brandon to a@example.com;b@example.com. In the list view of crm, add the select all leads and change their customer to Brandon (the customer column is not displayed by default, just make it visible). Create a new mass-mailing with the recipient list as "Lead/Opportunity". Start the campaign. Brandon receives as many emails as there are leads but he shall only receive one. The system has a known limitation when it comes to filtering duplicates: it skips all records that have multiple recipients. In this case Brandon has two: [a@example.com](mailto:a@example.com) and [b@example.com](mailto:b@example.com). The de-duplication mechanism was skipped for every lead he was the customer of and each time a new email was sent, spamming him. In this work we make it possible to also process records with multiple recipients. It is a best-effort and will still let some duplicates through. Nonetheless it solves the current problem with minimal changes. Note: any([]) and any(['']) are both False while all([]) is True, hence we now check for empty list / empty email first otherwise an empty list would be considered to be opt-out instead of empty. Task-3927361 closes #188426 Forward-port-of: #186799 Forward-port-of: #186149 Signed-off-by: Julien Castiaux (juc) <juc@odoo.com> Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Install mass-mailing and crm. Change the email address of Brandon to a@example.com;b@example.com. In the list view of crm, add the select all leads and change their customer to Brandon (the customer column is not displayed by default, just make it visible). Create a new mass-mailing with the recipient list as "Lead/Opportunity". Start the campaign. Brandon receives as many emails as there are leads but he shall only receive one.
The system has a known limitation when it comes to filtering duplicates: it skips all records that have multiple recipients. In this case Brandon has two: a@example.com and b@example.com. The de-duplication mechanism was skipped for every lead he was the customer of and each time a new email was sent, spamming him.
In this work we make it possible to also process records with multiple recipients. It is a best-effort and will still let some duplicates through. Nonetheless it solves the current problem with minimal changes.
Note: any([]) and any(['']) are both False while all([]) is True, hence we now check for empty list / empty email first otherwise an empty list would be considered to be opt-out instead of empty.
Task-3927361
Forward-Port-Of: #186799
Forward-Port-Of: #186149