I notice we already have an example for programmatically creating a new user in Create a user programmatically and give they a role. However, this example uses user_save()
, which does not mimic the registration process, (e.g. no email is sent to the user).
Could I use user_register_submit()?