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: