Can I add users to Discourse without sending invites?

AI-generated summary

Creating Accounts without Sending Invites in Discourse

AlphaWeaver is transitioning a community to Discourse and wants to create accounts for users without sending invites, allowing him to send announcements through the forums.

Pravi suggests using the Discourse console to create accounts without inviting users, by running the following commands:

rails c
u = User.create!(username: "name", email: "name@email.com", password: "password")
u.approve(Discourse.system_user, false) # if manual approvals are required
u.activate

However, itsbhanusharma cautions that users must have given consent to receive emails, and codinghorror warns against spamming users.

Alternatively, pfaffman suggests forcing all users to watch a category. Additionally, JimPas reminds administrators to consider the default time period for users to change their username, which can be adjusted in the site settings.

I’m transitioning a community to Discourse, and I have a list of email addresses. I’d like to create accounts for each user, so I can send them emails through the forums, but don’t intend for them to be able to post yet. I’m trying to (at first) just use Discourse as a platform to send out announcements.

Can I import a list of email addresses without sending invites to each person?

If you are planning to create accounts without signing up or inviting, then here is a method you can try in your console.

rails c
u = User.create!(username: "name", email: "name@email.com", password: "password")
u.approve(Discourse.system_user, false) # if manual approvals are required
u.activate

Just make sure that You have a consent from these users. Also, They can only really receive the Discourse Summary emails as discourse doesn’t have any built-in newsletter or mailer functionality beyond that.

You could force all users to watch a category.

You can … but you will also “force” these users to .. well, hate you for spamming them. :wink:

Don’t forget the default time period for users to be able to change their username is 3 days. Some users may not want their username to be the prefix of their email. The setting is in admin/site_setting/category/users. You may want to increase the number of days to allow them to log in and make any changes.