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?
CiviCRM Stack Exchange is a question and answer site for administrators and users of the CiviCRM Constituent Relationship Management software. It only takes a minute to sign up.Sign up to join this community
Check out this post, 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.