Ability to create a user group with the "inverse" of users with an email domain

I want to create a user group that is everyone except those with, say, @domain.com. Is this possible today in Discourse?

I’m fairly certain that you would need a custom plugin.

I think it would be pretty easy, an hour or two, depending on the details like how easily it can be configured and if there are specs.

Thinking more…not only would this be a great feature, but also the ability to create a dynamic user group based on a data explorer query.

1 Like

Or be able to use badge sql to award a badge that would add someone to a group. That would be pretty easy too.

3 Likes

I believe email addresses are sent in webhook payloads when a user account is created, so could this also be implemented using webhooks and the API (e.g. for sites hosted by CDCK that can’t use badge SQL)?

2 Likes

Yes, I confirme they are. :slight_smile:

So you could use some automation tool to update groups like Trigger a Zapier task with Discourse Webhooks. That could be a lot of requests for Zapier to handle, so it could get expensive.

1 Like

What do you do with everyone sans a domain/group? Knowing how you’d use that group will flesh out this feature. :slight_smile:

If you are going to get webhooks involved, I would add everyone to the target group, create a second programmatic group with domain.com auto-added, and then only fire off webhooks only on user events from the second group, which removes those accounts from both groups.

I… spend a lot time budgeting webhooks. :sweat_smile:

2 Likes

My immediate use case was creating a user group of all users minus employees.

2 Likes