Answers.Body: <p>Check out <a href="https://civicrm.org/blogs/petednz/creating-drupal-users-made-easy-single-or-multiple-contacts-civi-imports-and-webforms" rel="nofollow">this post</a>, which uses CiviCRM Entity and Rules to create Drupal users when Civi contacts are created.</p>
  
  <p>Within the CiviCRM Entity module, check out the function <code>civicrm_entity_action_create_user()</code> to see how the username is set. You could patch it to implement a way to choose a username field/pattern, rather than hard-coding it to the Civi Display Name field. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-26T15:43:00.620Z
Answers.Text: Thats great...but how can i make username same as email address
Answers.UserDisplayName: Juyal Jee
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-26T16:46:23.243Z
Answers.Text: I edited the answer with an additional tip.
Answers.UserDisplayName: Nicholai
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-26T17:12:11.423Z
Answers.Text: The latest beta version of CiviCRM Entity allows you to choose a format for the user name in the rule action edit form.  Use of the email address is now supported
Answers.UserDisplayName: jackrabbithanna
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-07-22T18:06:58.143Z
Answers.LastActivityDate: 2015-07-26T16:46:07.770Z
Answers.LastEditDate: 2015-07-26T16:46:07.770Z
Answers.UserDisplayName: Nicholai
Body: <p>I want to create new users in Drupal 7 whenever there is a new contact created from the civicrm.   </p>
  
  <p>Also, how can I use the civicrm primary email address as a username in the Drupal 7?</p>
  
  <p>Please suggest</p>
  
Tags: <drupal><civicrm-entity>
Title: Is there a Civicrm hook for new contact/user insert?
ThreadText: # Is there a Civicrm hook for new contact/user insert?
  
  (Asked by: username_0 on 2015-07-22)
  
  I want to create new users in Drupal 7 whenever there is a new contact created from the civicrm.
  
  Also, how can I use the civicrm primary email address as a username in the Drupal 7?
  
  Please suggest
  
  **Tags:** drupal, civicrm-entity
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-07-22. Score: 2
  
  Check out [this post](https://civicrm.org/blogs/petednz/creating-drupal-users-made-easy-single-or-multiple-contacts-civi-imports-and-webforms), which uses CiviCRM Entity and Rules to create Drupal users when Civi contacts are created.
  
  Within the CiviCRM Entity module, check out the function `civicrm_entity_action_create_user()` to see how the username is set. You could patch it to implement a way to choose a username field/pattern, rather than hard-coding it to the Civi Display Name field.
  
  > **Comments:**
  > **username_0**: Thats great...but how can i make username same as email address  
  > **username_1**: I edited the answer with an additional tip.  
  > **username_2**: The latest beta version of CiviCRM Entity allows you to choose a format for the user name in the rule action edit form.  Use of the email address is now supported  
  
  ---
  
  