# Welcome email not sent when adding user from console

**URL:** <https://meta.discourse.org/t/welcome-email-not-sent-when-adding-user-from-console/59765>\
**Category:** Product Support\
**Created:** [23.Март.2017 13:36:02 UTC](https://meta.discourse.org/t/welcome-email-not-sent-when-adding-user-from-console/59765 "2017-03-23T13:36:02Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![nordize](https://avatars.discourse-cdn.com/v4/letter/n/c68b51/32.png) [@nordize](https://meta.discourse.org/u/nordize)\
**Post date:** [26.Март.2017 18:17:01 UTC](https://meta.discourse.org/t/welcome-email-not-sent-when-adding-user-from-console/59765/6 "2017-03-26T18:17:01Z")

</div>

@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:

```plaintext
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.

---

_[View the full topic](https://meta.discourse.org/t/welcome-email-not-sent-when-adding-user-from-console/59765)._
