@neil awesome! Thanks. That was the pointer I needed.
I wanted the “choose a password” email (rather than “password reset” which is confusing for a new user), so I replaced type: :forgot_password with type: :account_created … job done.
For anyone looking for the full command list:
rails c
u = User.new({username: 'foo', email: 'foo@domain.com', name: 'Foo', trust_level: 1, password: SecureRandom.hex});
u.activate();
u.approve(1); # approved by user id 1, which is normally the first admin account
t = u.email_tokens.create(email: u.email);
Jobs.enqueue(:critical_user_email, type: :account_created, user_id: u.id, email_token: t.token);
The option must approve users is disabled in Settings.