How to create new user with verified email in development mode?

Hi, I’m new to Discourse and I already searched for I’m looking for.
I’m going to make some plugins and I need to create users to test it. I’m trying to creating users with temporary emails, but Discourse never send a email confirmation. It’s happening due to localhost? I don’t know.
I have followed this Beginners Guide to Install Discourse on Ubuntu for Development and my Discourse forum is running perfectly. I tried to create a user with RAILS_ENV=development bundle exec rake admin:create, but I can’t login since I have to confirm the email. How can I create a user with verified email? Thank you.

1 Like

Did you run mailcatcher as specified in that topic?

When you do, it’ll receive email sent to it by your development install and you can view it in a web browser.

→ mailcatcher --http-ip 0.0.0.0
Starting MailCatcher
==> smtp://127.0.0.1:1025
/home/michael/.rvm/gems/ruby-2.6.2@discourse/gems/thin-1.5.1/lib/thin/server.rb:104: warning: constant ::Fixnum is deprecated
==> http://0.0.0.0:1080/
*** MailCatcher runs as a daemon by default. Go to the web interface to quit.

8 Likes

I didn’t know about it (the 0.0.0:1080 thing). Thank you for your quick answer.
Is “bundle exec sidekiq” necessary? What is this for?

Yep. It is for running background jobs, like sending email.

4 Likes

You can also login as any user in development mode using the following path:

/session/:username/become

So if you want to log in to a user with “test1” as a username your URL will look something like:

http://localhost:3000/session/test1/become

7 Likes