notify user account creation? I can't seem to find documentation for notifying a user via email after their account has been created by a script.

$user = \Drupal\user\Entity\User::create();

$user-&gt;setPassword('xxx');
$user-&gt;enforceIsNew();
$user-&gt;setEmail('xxx+'.time().'@gmail.com');
$user-&gt;setUsername('xxx'.time());

$user-&gt;set('init', 'email');
$user-&gt;set('langcode', $language);
$user-&gt;set('preferred_langcode', $language);
$user-&gt;set('preferred_admin_langcode', $language);
$user-&gt;activate();

//$user-&gt;notify()? something?

$result = $user-&gt;save();
You can find the configuration on admin in the /admin/config/people/accounts but if you want to notify the user programmatically without taking care of what is the config you can use _user_mail_notify function.

_user_mail_notify documentation