2

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

2

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.

  • Thats great...but how can i make username same as email address – Juyal Jee Jul 26 '15 at 15:43
  • 1
    I edited the answer with an additional tip. – Nicholai Jul 26 '15 at 16:46
  • 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 – jackrabbithanna Mar 26 '17 at 17:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.