This CodeLet allows to set the user password during Rule execution, the following process can be used.

  1. create user entity ($newuser)
  2. set a rules variable $password (use PHP code to generate a random string)
  3. execute custom PHP which looks like

This way, you can also use the variable $password in say, an email to the user letting them know what their automatically generated password is.

CodeLet
<?php$edit = array('pass' => $password,);user_save($newuser, $edit);?>
brad.curnow
Enroll to Drupal 10 Training