Answers.Body: <p>Hopefully someone else comes by with a simple strategy - here is an off the cuff idea.</p>
  
  <p>a/ you know the emails you sent to
  b/ if you import emails then you can add them to a Group
  c/ i don't know if when you import an email that is used by several folk they all get updated, it may only update the lowest cid
  d/ if the import does do what you want then you can probably figure that path from there</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-07T16:29:49.107Z
Answers.Text: Thanks Pete.
  
  As far as I've seen, if you import an email that matches two contacts, you'll actually create a third, new contact, which will be added to the group specified, and neither of the original contacts will be added to the group.
Answers.UserDisplayName: Lars SG
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-07T20:07:42.210Z
Answers.Text: That should not happen if the 'update' is set and the right Dedupe rule is chosen, but as stated i v much doubted that it would cause it to add both contacts unfortunately. grabbing all the emails and doing an sql insert to add the relevant contacts to a group would be another route i suppose
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-09T20:25:36.177Z
Answers.Text: In the end, I just did it in Excel, which was a pain, but not that bad. Thanks for the suggestions!
Answers.UserDisplayName: Lars SG
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-10-12T00:47:23.450Z
Answers.Text: Here's an issue proposing doing exactly that:
  https://lab.civicrm.org/dev/core/-/issues/3907
Answers.UserDisplayName: Lars SG
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-10-12T00:48:22.430Z
Answers.Text: And for completeness, here's a better solution to finding those emails via API4 explorer, which I've been using:
  https://civicrm.stackexchange.com/a/38496/3533
Answers.UserDisplayName: Lars SG
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-01-21T10:36:35.747Z
Answers.Text: We had this issue in our internal tracker as well. Since it is a fairly edge case I decided not to raise an issue in CiviCRM's tracker for a feature request, and just make a note in our documentation. But if anyone else comes across this issue then feel free to raise the request. It would be relatively straightforward to add functionality to the 'Exlcude previous recipients' logic, to exclude 'email addresses' as well as 'contacts' that received the previous mailing =]
Answers.UserDisplayName: John
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-12-07T04:13:37.923Z
Answers.LastActivityDate: 2018-12-07T04:13:37.923Z
Answers.UserDisplayName: petednz - fuzion
Body: <p>We'd like to send a mailing in a few slightly different versions to different groups. What we'd like to avoid is having two contacts, who share the same email address and are in different groups, receive two different versions of the email.</p>
  
  <p>Deduping happens before a specific mailing is sent and I can exclude previous contacts who were recipients of the first mailing from the next mailing, but what I am trying to do is exclude previously emailed <strong>addresses</strong> from the next mailing, not just previously emailed contacts.</p>
  
  <p>Is there any way to either exclude previously emailed addresses directly or to search for contacts who share a primary email with contacts in a previous mailing or group?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-12-07T03:42:24.487Z
Comments.Text: And no, testing shows that this doesn't happen automatically if you exclude previous recipients of a mailing.
Comments.UserDisplayName: Lars SG
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-12-07T04:11:44.207Z
Comments.Text: what sort of number of folk sharing emails do you have?
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-12-07T04:13:33.733Z
Comments.Text: the simple answer i think for you is 'no'. but if v low, then make a Group of the folk who already received the email (or use the group you already had for the mailing if suitable), set up a dedupe rule to find all the folk sharing that same email, and go tag them all (manually one at a time!), or do some sql if you have the skills. one other idea i will put as an Answer but suspect it won't work
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-12-07T16:21:57.103Z
Comments.Text: Not entirely sure how many, but certainly high hundreds, maybe into the thousands.
  
  Can't do anything with deduping, as the majority are already marked as non-duplicates.
Comments.UserDisplayName: Lars SG
Tags: <civimail><email><duplicate-contacts>
Title: Can multiple mailings have deduplicated email addresses, so each address will not receive multiple emails?
ThreadText: # Can multiple mailings have deduplicated email addresses, so each address will not receive multiple emails?
  
  (Asked by: username_0 on 2018-12-07)
  
  We'd like to send a mailing in a few slightly different versions to different groups. What we'd like to avoid is having two contacts, who share the same email address and are in different groups, receive two different versions of the email.
  
  Deduping happens before a specific mailing is sent and I can exclude previous contacts who were recipients of the first mailing from the next mailing, but what I am trying to do is exclude previously emailed **addresses** from the next mailing, not just previously emailed contacts.
  
  Is there any way to either exclude previously emailed addresses directly or to search for contacts who share a primary email with contacts in a previous mailing or group?
  
  **Tags:** civimail, email, duplicate-contacts
  
  > **Comments:**
  > **username_0**: And no, testing shows that this doesn't happen automatically if you exclude previous recipients of a mailing.  
  > **username_1**: what sort of number of folk sharing emails do you have?  
  > **username_1**: the simple answer i think for you is 'no'. but if v low, then make a Group of the folk who already received the email (or use the group you already had for the mailing if suitable), set up a dedupe rule to find all the folk sharing that same email, and go tag them all (manually one at a time!), or do some sql if you have the skills. one other idea i will put as an Answer but suspect it won't work  
  > **username_0**: Not entirely sure how many, but certainly high hundreds, maybe into the thousands.  Can't do anything with deduping, as the majority are already marked as non-duplicates.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-12-07. Score: 1
  
  Hopefully someone else comes by with a simple strategy - here is an off the cuff idea.
  
  a/ you know the emails you sent to
  b/ if you import emails then you can add them to a Group
  c/ i don't know if when you import an email that is used by several folk they all get updated, it may only update the lowest cid
  d/ if the import does do what you want then you can probably figure that path from there
  
  > **Comments:**
  > **username_0**: Thanks Pete.  As far as I've seen, if you import an email that matches two contacts, you'll actually create a third, new contact, which will be added to the group specified, and neither of the original contacts will be added to the group.  
  > **username_1**: That should not happen if the 'update' is set and the right Dedupe rule is chosen, but as stated i v much doubted that it would cause it to add both contacts unfortunately. grabbing all the emails and doing an sql insert to add the relevant contacts to a group would be another route i suppose  
  > **username_0**: In the end, I just did it in Excel, which was a pain, but not that bad. Thanks for the suggestions!  
  > **username_2**: We had this issue in our internal tracker as well. Since it is a fairly edge case I decided not to raise an issue in CiviCRM's tracker for a feature request, and just make a note in our documentation. But if anyone else comes across this issue then feel free to raise the request. It would be relatively straightforward to add functionality to the 'Exlcude previous recipients' logic, to exclude 'email addresses' as well as 'contacts' that received the previous mailing =]  
  > **username_0**: Here's an issue proposing doing exactly that: https://lab.civicrm.org/dev/core/-/issues/3907  
  > **username_0**: And for completeness, here's a better solution to finding those emails via API4 explorer, which I've been using: https://civicrm.stackexchange.com/a/38496/3533  
  
  ---
  
  