Answers.Body: <p>Given that WordPress treats email addresses as unique identifiers, this situation is necessarily going to be problematic. There are a number of ways that you can overcome the default matching (which is handled by CiviCRM's <code>CRM_Core_BAO_UFMatch::synchronizeUFMatch()</code> method), but the simplest is to manually alter the record in the <code>ufMatch</code> table such that it points to the Civi record that you want it to. You can alternatively create the WordPress users from their CiviCRM contact records by using the bulk update functionality provided when you enable <code>CIVICRM_WP_PROFILE_SYNC_BULK</code> in the plugin. Or perhaps you could decide not to "forget that there may be methods of better organizing this"...</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-18T10:56:11.333Z
Answers.Text: Thanks! What I've been doing amounts to a (terrible) work-around - although it does work. The above problem arises because:
Answers.UserDisplayName: Abteilung Gerontopsychiatrie
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-18T11:04:40.980Z
Answers.Text: (continued) 1.) People become WP users via the WPUM plugin, 2.) that creates and syncs a contact via CiviCRM WordPress Profile Sync, 3.) these new contacts populate CiviCRM profiles that ultimately let them become members of an orgnization. 4.) Before they send off the registration form, they get the option to terminate - and by doing so delete there WP user account. 5.) No way to delete there CiviCRM contact... What I've done: creat CiviCRM groups to distinguish those completing registration vs. abort -> search for those (scheduled job) -> delete contacts found -> voila, no conflict.
Answers.UserDisplayName: Abteilung Gerontopsychiatrie
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-18T13:33:51.047Z
Answers.Text: If you've found a working solution, perhaps you could post it as an answer to your question? It will help others in the future!
Answers.UserDisplayName: Christian Wach
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-23T11:05:49.317Z
Answers.Text: Answer is in my comment ;) "What I've done: create CiviCRM groups [...]".
Answers.UserDisplayName: Abteilung Gerontopsychiatrie
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-23T18:28:41.920Z
Answers.Text: That's not what I meant - I meant click "Add Another Answer" below, add your answer there, then mark it as the solution to your original question.
Answers.UserDisplayName: Christian Wach
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-17T16:30:58.413Z
Answers.LastActivityDate: 2016-10-17T16:30:58.413Z
Answers.UserDisplayName: Christian Wach
Body: <p>Following use-case:</p>
  
  <ol>
  <li>CiviCRM has many contacts, including contacts of individuals with the same primary email address (e.g. one corporate email, two
      individuals (contacts) working there) -> forget that there may be
      methods of better organizing this.</li>
  <li>Both contacts do not have a WP user account.</li>
  <li>CiviCRM WordPress Profile Sync is working</li>
  <li>One of the individuals registers with WP using THAT email</li>
  <li>Which contact does the new WP user get associated with?   </li>
  <li>Testing it as best as I could the answer is: <strong>always with the lowest CiviCRM ID</strong></li>
  </ol>
  
  <p>I've tried to find if there's a reference to it in the <a href="https://github.com/christianwach/civicrm-wp-profile-sync/blob/master/civicrm-wp-profile-sync.php" rel="nofollow">plugin's PHP </a>, or elsewhere.</p>
  
  <p>Wondering if this is by default?</p>
  
  <p>Cheers</p>
  
Tags: <wordpress><php>
Title: Profile sync using CiviCRM WordPress Profile Sync
ThreadText: # Profile sync using CiviCRM WordPress Profile Sync
  
  (Asked by: username_0 on 2016-10-12)
  
  Following use-case:
  
  1. CiviCRM has many contacts, including contacts of individuals with the same primary email address (e.g. one corporate email, two
     individuals (contacts) working there) -> forget that there may be
     methods of better organizing this.
  2. Both contacts do not have a WP user account.
  3. CiviCRM WordPress Profile Sync is working
  4. One of the individuals registers with WP using THAT email
  5. Which contact does the new WP user get associated with?
  6. Testing it as best as I could the answer is: **always with the lowest CiviCRM ID**
  
  I've tried to find if there's a reference to it in the [plugin's PHP](https://github.com/username_1/civicrm-wp-profile-sync/blob/master/civicrm-wp-profile-sync.php) , or elsewhere.
  
  Wondering if this is by default?
  
  Cheers
  
  **Tags:** wordpress, php
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-10-17. Score: 1
  
  Given that WordPress treats email addresses as unique identifiers, this situation is necessarily going to be problematic. There are a number of ways that you can overcome the default matching (which is handled by CiviCRM's `CRM_Core_BAO_UFMatch::synchronizeUFMatch()` method), but the simplest is to manually alter the record in the `ufMatch` table such that it points to the Civi record that you want it to. You can alternatively create the WordPress users from their CiviCRM contact records by using the bulk update functionality provided when you enable `CIVICRM_WP_PROFILE_SYNC_BULK` in the plugin. Or perhaps you could decide not to "forget that there may be methods of better organizing this"...
  
  > **Comments:**
  > **username_0**: Thanks! What I've been doing amounts to a (terrible) work-around - although it does work. The above problem arises because:  
  > **username_0**: (continued) 1.) People become WP users via the WPUM plugin, 2.) that creates and syncs a contact via CiviCRM WordPress Profile Sync, 3.) these new contacts populate CiviCRM profiles that ultimately let them become members of an orgnization. 4.) Before they send off the registration form, they get the option to terminate - and by doing so delete there WP user account. 5.) No way to delete there CiviCRM contact... What I've done: creat CiviCRM groups to distinguish those completing registration vs. abort -> search for those (scheduled job) -> delete contacts found -> voila, no conflict.  
  > **username_1**: If you've found a working solution, perhaps you could post it as an answer to your question? It will help others in the future!  
  > **username_0**: Answer is in my comment ;) "What I've done: create CiviCRM groups [...]".  
  > **username_1**: That's not what I meant - I meant click "Add Another Answer" below, add your answer there, then mark it as the solution to your original question.  
  
  ---
  
  