Add users to a group based on their email domain

Discourse allows you to automatically add users to a custom group based on the email domain that they register with. To set this up, add the email domain to the Automatic section of the group’s configuration page:

Select the “Apply the same email domain rule to add existing registered users” checkbox to add existing users who have emails on your chosen domain to the group. Existing users will be added to the group when you save or update the group.

Note: this setting is only available for custom groups that you create, but it can be used to automatically grant membership in a Discourse Trust Level group by combining it with the group’s automatic Trust Level setting:

7 Likes

Hi Simon i don’t seeme to be able to see this setting when setting up the automatic rules. Any idea why?

Thanks for pointing that out. It looks like that setting has been removed. Existing users are now automatically added to the group. This is probably the desired behaviour for most cases. One thing I noticed is that when saving the changes after a domain has been added to the setting, a modal window lets you know about the changes, but there is no obvious way to back out of the change:

I’ll update this topic’s first post to describe the new behaviour. The copy that we use for the “Automatic” setting also needs to be updated to make it clear that it affects all users on the site.

1 Like