Answers.Body: <p>You probably want to reconsider what you want. Having unique email addresses is generally a good thing, and CiviCRM can be set up to help you keep them unique. But there are good reasons that this is not hard-wired as you'll probably discover.</p>
  <p>If duplicate emails are getting created that are not what you want, then you probably want to review how that is happening and fix that particular workflow. For example, it might be an employee that is importing contacts without using the dedupe option. Or it might be a registration form that is not configured to dedupe on creation. etc.</p>
  <p>In theory, your &quot;supervised&quot; dedupe rule should kick in when an administrator tries to create a new contact with an existing contact's address, but my experiment wasn't successful in testing this theory. If this is working as designed, then you could just update your supervised rule.</p>
  <p>But, even without this, you should see super useful messages pop up as you create a new contact using the admin interface, showing potential duplicates.</p>
  <p>Perhaps that functionality is not working? Or you might need some training so that you notice it?</p>
  <p>A hard &quot;never create contacts with duplicate email addresses&quot; is almost surely going to create new and gnarlier challenges (e.g. if an existing contact tries to use a registration form - do you allow or disallow that record to be updated?).</p>
  <p>For completeness, and to answer your question: the civirules extension would likely allow you to create a rule such as you are describing. Caveat Implementor!</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-01-12T00:49:32.823Z
Answers.Text: "CiviCRM is setup by default to keep them unique". not sure i would put it like that. certainly i don't think of it as being thus. i agree a Supervised matching rule can flag these, but if a public facing rule was First + Last + Email, then civi does nothing to prevent multiple contacts with the same email. (and not sure that using the matching rules that come with civi does prevent this in all situations) The CMS on the other hand will, so if contacts were only added via Profiles with 'create user' then duplicate emails could/should be prevented but isn't what the OP is after
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-01-12T20:57:36.550Z
Answers.Text: I am aware on how to import contacts and use the de-dupe rule. What I want to prevent is the creation of a new contact where the email already exists with another contact. If there is supposed to be a setting that prevents this from happening, then that is all I need. But with new install of CvivCRM, I can add a new individual contact with an email that exists for another individual contact, and it does not give me any kind of warning or notice... it just creates the new contact. I will look at civirules extension. Thanks
Answers.UserDisplayName: jsherk
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-01-17T17:40:02.580Z
Answers.Text: Okay, fair comments, I've updated my answer. In the not-to-recent-past, the 'supervised' rule was supposed to warn administrators if they were going to create a contact with an existing email address, but my tests failed to reproduce what I thought would/should happen. Again, hard-coding unique email addresses as a global rule is likely to generate new problems, so I strongly recommend that you focus on workflow-specific solutions.
Answers.UserDisplayName: Alan Dixon
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-01-22T18:07:24.533Z
Answers.Text: @AlanDixon You have click on the CHECK FOR MATCHING CONTACT(S) button first if you want to check for duplicate emails. If the EMAIL (RESERVED) dedupe rule is set to Unsupervised, then it will NOT find a match. If it is set to Supervised, then it will find a match. However this does not prevent the contact from being added in anyway (see my UPDATE to my question above).
Answers.UserDisplayName: jsherk
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-01-11T19:46:24.267Z
Answers.LastActivityDate: 2022-01-17T17:43:41.943Z
Answers.LastEditDate: 2022-01-17T17:43:41.943Z
Answers.UserDisplayName: Alan Dixon
Answers.Body: <p>Thanks for this information. One of the worst issues with NationBuilder is that email addresses are unique. This is fine until one has to manage partners who use the same email address. This is not uncommon for married couples, especially seniors.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-19T15:05:50.870Z
Answers.Text: One possible solution for partners sharing the same email address, is to ask them to use +PLUS email adresses: https://office-watch.com/2022/email-plus-addresses-how-to-use-them/
  So an example would be if their shared email is `jones@me.com` then they could use `jones+bob@me.com` and `jones+susan@me.com` ... both of these two emails (+bob and +susan) are unique from CiviCRM perspective, but they will still show up in the same shared inbox of `jones@me.com`
  This of course requires the end users to be in agreement and trained on how this works, so not a perfect solution.
Answers.UserDisplayName: jsherk
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-19T02:47:56.440Z
Answers.LastActivityDate: 2023-04-19T02:47:56.440Z
Answers.UserDisplayName: Carey Miller
Body: <p>Is there a way to prevent a new contact from being created if the email already exists with another contact?</p>
  <p>When a new contact is added, if the email already exists, I would like an error saying that contact can not be created because email already exists.</p>
  <p>Thanks</p>
  <p>UPDATE: So to add further details about my question...</p>
  <p><strong>OTHER AREAS LIKE EVENTS</strong>
  One of the comments below stated &quot;if an existing contact tries to use a registration form do you allow or disallow that record to be updated?&quot;. So I am not sure exactly how CiviCRM works, but in this case above, I would want the existing contact information to be used, and would not want a new contact created. So I do not want to prevent updating of existing records, I would just want to prevent a duplicate contact with a duplicate email as being created. This particular scenario is probably something I will come across in the near future as we move forward with CiviCRM implementation, but is currently not an issue I have to deal with (yet).</p>
  <p><strong>IMPORTING</strong>
  I did notice that when I import contacts, I can choose DeDupe rule of EMAIL (RESERVED), and this will correctly skip importing any contact if the email already exists. So this is solved and is not an issue.</p>
  <p><strong>MANUAL ADDING CONTACT</strong>
  When manually adding a contact though, I am unable to prevent a user from adding a new contact with a duplicate email. I see there is a button that says CHECK FOR MATCHING CONTACT(S) ... If the EMAIL (RESERVED) rule is set to Unsupervised, then click this button does not find a match (even when one exists). If I change the rule to Supervised, then clicking the button will find a match. However this is still not the functionality that I want, as it still does not prevent the user from adding the contact if they either forget to click the CHECK FOR MATCHING CONTACT(S) button or if they choose to ignore the message that it found a match... This is</p>
  <p>So what I want to be able to do, specifically for Manually Adding Contacts, is that when the SAVE button is clicked it will just give an error message saying &quot;Contact Email already exists. Can not add new contact&quot;, or &quot;Contact Email already exists. Would you like to add it anyways?&quot;</p>
  <p>I looked at CiviRules but did not see how I can implement this using that module.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-01-10T11:24:05.880Z
Comments.Text: Do you want to prevent new contact via the front-end (eg event signups, memberships), or back-end admin GUI, imports, API etc?  What about if someone tries to change or add an existing address to a different existing contact?
Comments.UserDisplayName: Aidan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-01-11T13:16:05.900Z
Comments.Text: @aidan - My initial use case (as I am new to CiviCRM) is backend, but now that you ask the question, I want to prevent duplicate email in all cases that you mention (new contact from both front end and back end as well as if somebody tries to change their email and it already exists.)
Comments.UserDisplayName: jsherk
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-01-22T22:15:03.257Z
Comments.Text: skim read. is it possible to have your team instead use a Profile for 'add new contact' instead of using the inbuilt one. then, i think, it will apply the unsupervised rule and you can set profile to "Issue warning and do not save"
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-01-23T02:32:19.737Z
Comments.Text: @petednz-fuzion I am very new to CiviCRM so I will have to investigate what you mean by using a Profile to enter a contact ... that sounds like that could be a solution.
Comments.UserDisplayName: jsherk
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-01-24T18:58:27.493Z
Comments.Text: Go to Customise > Profiles. You will see a Reserved Profile tab, which is where the existing 'New Individual' profile will show. You can just make yourself a new one and set the rule to apply.
Comments.UserDisplayName: petednz - fuzion
Tags: <contacts>
Title: Prevent contact from being created with duplicate email (make email unique)
ThreadText: # Prevent contact from being created with duplicate email (make email unique)
  
  (Asked by: username_0 on 2022-01-09)
  
  Is there a way to prevent a new contact from being created if the email already exists with another contact?
  
  When a new contact is added, if the email already exists, I would like an error saying that contact can not be created because email already exists.
  
  Thanks
  
  UPDATE: So to add further details about my question...
  
  **OTHER AREAS LIKE EVENTS**
  One of the comments below stated "if an existing contact tries to use a registration form do you allow or disallow that record to be updated?". So I am not sure exactly how CiviCRM works, but in this case above, I would want the existing contact information to be used, and would not want a new contact created. So I do not want to prevent updating of existing records, I would just want to prevent a duplicate contact with a duplicate email as being created. This particular scenario is probably something I will come across in the near future as we move forward with CiviCRM implementation, but is currently not an issue I have to deal with (yet).
  
  **IMPORTING**
  I did notice that when I import contacts, I can choose DeDupe rule of EMAIL (RESERVED), and this will correctly skip importing any contact if the email already exists. So this is solved and is not an issue.
  
  **MANUAL ADDING CONTACT**
  When manually adding a contact though, I am unable to prevent a user from adding a new contact with a duplicate email. I see there is a button that says CHECK FOR MATCHING CONTACT(S) ... If the EMAIL (RESERVED) rule is set to Unsupervised, then click this button does not find a match (even when one exists). If I change the rule to Supervised, then clicking the button will find a match. However this is still not the functionality that I want, as it still does not prevent the user from adding the contact if they either forget to click the CHECK FOR MATCHING CONTACT(S) button or if they choose to ignore the message that it found a match... This is
  
  So what I want to be able to do, specifically for Manually Adding Contacts, is that when the SAVE button is clicked it will just give an error message saying "Contact Email already exists. Can not add new contact", or "Contact Email already exists. Would you like to add it anyways?"
  
  I looked at CiviRules but did not see how I can implement this using that module.
  
  **Tags:** contacts
  
  > **Comments:**
  > **username_1**: Do you want to prevent new contact via the front-end (eg event signups, memberships), or back-end admin GUI, imports, API etc?  What about if someone tries to change or add an existing address to a different existing contact?  
  > **username_0**: @aidan - My initial use case (as I am new to CiviCRM) is backend, but now that you ask the question, I want to prevent duplicate email in all cases that you mention (new contact from both front end and back end as well as if somebody tries to change their email and it already exists.)  
  > **username_2**: skim read. is it possible to have your team instead use a Profile for 'add new contact' instead of using the inbuilt one. then, i think, it will apply the unsupervised rule and you can set profile to "Issue warning and do not save"  
  > **username_0**: @petednz-fuzion I am very new to CiviCRM so I will have to investigate what you mean by using a Profile to enter a contact ... that sounds like that could be a solution.  
  > **username_2**: Go to Customise > Profiles. You will see a Reserved Profile tab, which is where the existing 'New Individual' profile will show. You can just make yourself a new one and set the rule to apply.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2022-01-11. Score: 2
  
  You probably want to reconsider what you want. Having unique email addresses is generally a good thing, and CiviCRM can be set up to help you keep them unique. But there are good reasons that this is not hard-wired as you'll probably discover.
  
  If duplicate emails are getting created that are not what you want, then you probably want to review how that is happening and fix that particular workflow. For example, it might be an employee that is importing contacts without using the dedupe option. Or it might be a registration form that is not configured to dedupe on creation. etc.
  
  In theory, your "supervised" dedupe rule should kick in when an administrator tries to create a new contact with an existing contact's address, but my experiment wasn't successful in testing this theory. If this is working as designed, then you could just update your supervised rule.
  
  But, even without this, you should see super useful messages pop up as you create a new contact using the admin interface, showing potential duplicates.
  
  Perhaps that functionality is not working? Or you might need some training so that you notice it?
  
  A hard "never create contacts with duplicate email addresses" is almost surely going to create new and gnarlier challenges (e.g. if an existing contact tries to use a registration form - do you allow or disallow that record to be updated?).
  
  For completeness, and to answer your question: the civirules extension would likely allow you to create a rule such as you are describing. Caveat Implementor!
  
  > **Comments:**
  > **username_2**: "CiviCRM is setup by default to keep them unique". not sure i would put it like that. certainly i don't think of it as being thus. i agree a Supervised matching rule can flag these, but if a public facing rule was First + Last + Email, then civi does nothing to prevent multiple contacts with the same email. (and not sure that using the matching rules that come with civi does prevent this in all situations) The CMS on the other hand will, so if contacts were only added via Profiles with 'create user' then duplicate emails could/should be prevented but isn't what the OP is after  
  > **username_0**: I am aware on how to import contacts and use the de-dupe rule. What I want to prevent is the creation of a new contact where the email already exists with another contact. If there is supposed to be a setting that prevents this from happening, then that is all I need. But with new install of CvivCRM, I can add a new individual contact with an email that exists for another individual contact, and it does not give me any kind of warning or notice... it just creates the new contact. I will look at civirules extension. Thanks  
  > **username_3**: Okay, fair comments, I've updated my answer. In the not-to-recent-past, the 'supervised' rule was supposed to warn administrators if they were going to create a contact with an existing email address, but my tests failed to reproduce what I thought would/should happen. Again, hard-coding unique email addresses as a global rule is likely to generate new problems, so I strongly recommend that you focus on workflow-specific solutions.  
  > **username_0**: @AlanDixon You have click on the CHECK FOR MATCHING CONTACT(S) button first if you want to check for duplicate emails. If the EMAIL (RESERVED) dedupe rule is set to Unsupervised, then it will NOT find a match. If it is set to Supervised, then it will find a match. However this does not prevent the contact from being added in anyway (see my UPDATE to my question above).  
  
  ---
  
  ### Answer by username_4 on 2023-04-19. Score: 0
  
  Thanks for this information. One of the worst issues with NationBuilder is that email addresses are unique. This is fine until one has to manage partners who use the same email address. This is not uncommon for married couples, especially seniors.
  
  > **Comments:**
  > **username_0**: One possible solution for partners sharing the same email address, is to ask them to use +PLUS email adresses: https://office-watch.com/2022/email-plus-addresses-how-to-use-them/ So an example would be if their shared email is `jones@me.com` then they could use `jones+bob@me.com` and `jones+susan@me.com` ... both of these two emails (+bob and +susan) are unique from CiviCRM perspective, but they will still show up in the same shared inbox of `jones@me.com` This of course requires the end users to be in agreement and trained on how this works, so not a perfect solution.  
  
  ---
  
  