Answers.Body: <p>On the Drupal side, there is a <a href="https://www.drupal.org/project/multiple_email" rel="nofollow noreferrer"><strong>Multiple Email Address</strong></a> module that will allow for multiple emails to be associated with the same user account (not sure if you can configure specific email fields to map to the corresponding location types in Civi such that whatever changes/additional emails are added on the Drupal side would be communicated to the same contact record on the Civi side - you might want to check on that). The first paragraph at the link above indicates the following:</p>
  
  <blockquote>
    <p>Only one e-mail address is considered to be the "primary" email address, and will continue to behave as normal. Non-primary accounts are mostly functionally meaningless, except that during user registration any e-mail address registered to a user cannot be used to create a new account.</p>
  </blockquote>
  
  <p>The Multiple Email Address module will in effect prevent duplicate contacts from being created in Civi as well.</p>
  
  <p>Without this module, there is a 1:1 relationship between a drupal user account and a primary email address of a Civi contact record (keep in mind, the primary email address can be of any location type - if you were able to login with more than one email address without having the above module installed, it may be that you have duplicate contact records in Civi with a different email location set as primary - you can check the civi contact IDs associated with the drupal user IDs directly in the database in civicrm_uf_match). With regards to duplicate matching, the default behavior is as follows:</p>
  
  <ul>
  <li>When a user creates a Drupal user account using anything other than a primary email address of an existing Civi contact record, a new contact record is created in Civi</li>
  <li>If a user attempts to login with an email address that is not their primary email address, they will not succeed</li>
  <li>Conversely, Drupal does not allow a duplicate user record to be created for the same primary email address</li>
  </ul>
  
  <p>You mention additional email fields are not displaying in the Name and Address profile - I am assuming this is a Civi profile configured with email fields of various location types - the same behavior happens on my end and I have a faint recollection of this being a programmed behavior to avoid overwriting the primary email address - but not 100% sure about this - anyone else who can confirm that please chime in.</p>
  
  <p>Hope this helps!</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-26T13:24:33.003Z
Answers.Text: Hi Tamar - thank you, that is really helpful.  I have considered this and decided to go down a more custom programmatic route that suits where we heading strategically. I am doing additional validation on the forms that we have in the system for adding new users (we have a custom area for other business activities).  when it is tested, I'll post it as it may be of interest to others.  Thanks again. Martin
Answers.UserDisplayName: ChumKui
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-26T16:33:57.583Z
Answers.Text: Glad I could help!
Answers.UserDisplayName: Tamar Meir - Cividesk
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-25T23:43:52.037Z
Answers.LastActivityDate: 2018-09-25T23:43:52.037Z
Answers.UserDisplayName: Tamar Meir - Cividesk
Body: <p>We use Drupal and have a lot of users with more than one email address (but not within the Drupal accounts) - they forget they registered with one email and try to use another to login and failing that, use this other address to create another account.  We thus get duplicate accounts.</p>
  
  <p>To add better account information etc to Drupal, i.e. to store proper address details and more than one email address, I thought I would try out CiviCRM.</p>
  
  <p>Last week I set up a local dev environment (Ubuntu 14.04, CiviCRM 5.5.2, Drupal 7.59, PHP5.6.37, MySQL  5.5.61) and synced users.  I amended the Name and Address profile to customise it to our requirements and so that users could amend their address details.</p>
  
  <p>I am 100% sure that when I tested someone trying to register through the (now amended) Drupal registration form, it would reject the registration if the email address was already in another field, like 'Other' or 'Home'.  I could also login to Drupal with any other the email addresses a CiviCRM user had in their record.</p>
  
  <p>I have rebuilt my environment (to prepare for a pilot) and the duplicate checking and login behaviour has now stopped...  I did a demo to a colleague and so I was not dreaming this!  I do not remember specifically 'enabling' duplicate checking etc, but it was working exactly as we needed and I was really pleased.  It also made logical sense that, as CiviCRM hooks into to the registration screen etc, that somewhere in the background there would be a check on existing email addresses etc.</p>
  
  <p>The other thing I notice is that I am unable to add other email addresses to the Name and Address profile - they just do not display.  They do in the user profile (from Drupal) so I am assuming that this is a permissions thing somewhere.</p>
  
  <p>Rebuilding has clearly reset something - does anyone anyone have any ideas as to why this behaviour has changed?</p>
  
  <p>Many thanks</p>
  
  <p>Martin</p>
  
Tags: <drupal><contacts><duplicate-contacts>
Title: Checking across all email addresses for contact registration
ThreadText: # Checking across all email addresses for contact registration
  
  (Asked by: username_0 on 2018-09-25)
  
  We use Drupal and have a lot of users with more than one email address (but not within the Drupal accounts) - they forget they registered with one email and try to use another to login and failing that, use this other address to create another account. We thus get duplicate accounts.
  
  To add better account information etc to Drupal, i.e. to store proper address details and more than one email address, I thought I would try out CiviCRM.
  
  Last week I set up a local dev environment (Ubuntu 14.04, CiviCRM 5.5.2, Drupal 7.59, PHP5.6.37, MySQL 5.5.61) and synced users. I amended the Name and Address profile to customise it to our requirements and so that users could amend their address details.
  
  I am 100% sure that when I tested someone trying to register through the (now amended) Drupal registration form, it would reject the registration if the email address was already in another field, like 'Other' or 'Home'. I could also login to Drupal with any other the email addresses a CiviCRM user had in their record.
  
  I have rebuilt my environment (to prepare for a pilot) and the duplicate checking and login behaviour has now stopped... I did a demo to a colleague and so I was not dreaming this! I do not remember specifically 'enabling' duplicate checking etc, but it was working exactly as we needed and I was really pleased. It also made logical sense that, as CiviCRM hooks into to the registration screen etc, that somewhere in the background there would be a check on existing email addresses etc.
  
  The other thing I notice is that I am unable to add other email addresses to the Name and Address profile - they just do not display. They do in the user profile (from Drupal) so I am assuming that this is a permissions thing somewhere.
  
  Rebuilding has clearly reset something - does anyone anyone have any ideas as to why this behaviour has changed?
  
  Many thanks
  
  Martin
  
  **Tags:** drupal, contacts, duplicate-contacts
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-09-25. Score: 3
  
  On the Drupal side, there is a [**Multiple Email Address**](https://www.drupal.org/project/multiple_email) module that will allow for multiple emails to be associated with the same user account (not sure if you can configure specific email fields to map to the corresponding location types in Civi such that whatever changes/additional emails are added on the Drupal side would be communicated to the same contact record on the Civi side - you might want to check on that). The first paragraph at the link above indicates the following:
  
  > Only one e-mail address is considered to be the "primary" email address, and will continue to behave as normal. Non-primary accounts are mostly functionally meaningless, except that during user registration any e-mail address registered to a user cannot be used to create a new account.
  
  The Multiple Email Address module will in effect prevent duplicate contacts from being created in Civi as well.
  
  Without this module, there is a 1:1 relationship between a drupal user account and a primary email address of a Civi contact record (keep in mind, the primary email address can be of any location type - if you were able to login with more than one email address without having the above module installed, it may be that you have duplicate contact records in Civi with a different email location set as primary - you can check the civi contact IDs associated with the drupal user IDs directly in the database in civicrm\_uf\_match). With regards to duplicate matching, the default behavior is as follows:
  
  * When a user creates a Drupal user account using anything other than a primary email address of an existing Civi contact record, a new contact record is created in Civi
  * If a user attempts to login with an email address that is not their primary email address, they will not succeed
  * Conversely, Drupal does not allow a duplicate user record to be created for the same primary email address
  
  You mention additional email fields are not displaying in the Name and Address profile - I am assuming this is a Civi profile configured with email fields of various location types - the same behavior happens on my end and I have a faint recollection of this being a programmed behavior to avoid overwriting the primary email address - but not 100% sure about this - anyone else who can confirm that please chime in.
  
  Hope this helps!
  
  > **Comments:**
  > **username_0**: Hi Tamar - thank you, that is really helpful.  I have considered this and decided to go down a more custom programmatic route that suits where we heading strategically. I am doing additional validation on the forms that we have in the system for adding new users (we have a custom area for other business activities).  when it is tested, I'll post it as it may be of interest to others.  Thanks again. Martin  
  > **username_1**: Glad I could help!  
  
  ---
  
  