title: Creating user with wp_insert_user & generated password - best way to notify new user including password?
body: <p>In a custom PHP page after a Paypal transaction is completed, I'm creating a WP user based off the information they've entered.  As it was, the wp_new_user_notification sent an email with "To set your password, visit the following address" link which seemed sloppy and unnecessary - and implied a forgotten password (at least on the bloated site I'm trying to change - that may not be the default behavior.)</p>
  
  <p>Alternatively, I just want to create the user and a WP generated password, then send them the details using something like this (I've omitted some non-relevant code): </p>
  
  <pre><code>$password = wp_generate_password( 12, true );
  $userdata = array(
      'user_login'  =&gt;  $email,
      'user_pass'    =&gt;  $password,
  );
  $user_id = wp_insert_user( $userdata ) ;
  if ( ! is_wp_error( $user_id ) ) {
      wp_new_user_notification( $user_id, null, both ); 
  }
  </code></pre>
  
  <p>Is there a practical way to use wp_new_user_notification to send the generated password in plain text so the receipient knows what it is?  Or do I need to make the custom PHP page send a custom e-mail while I have the non-hashed version available?</p>
  
  <p>Ultimately, I just want to create the user and sent them a 'welcome' email with their username and the generated password, just not sure the best approach and/or if I should be using the wp_new_user_notification function or not.  The code above still sends the default user notification email that I'm aware I can change via plugin - but not in such a way I can include the plain-text password as far as I can tell.</p>
  
  <p>Note: there's an older Q&amp;A at <a href="https://stackoverflow.com/questions/13509575/how-to-send-email-password-when-creating-a-new-user-by-api-in-wordpress">How to send email password when creating a new user by API in Wordpress?</a> that seems to cover it, but the plain text password appears to be depreciated?</p>