Automatically approving a subset of WordPress users

I am sure my best approach is discoverable here and I am researching accordingly but as a relatively new user of Discourse (just installed on my own VPS a few days ago), I am hoping someone can point me in the right direction for the following scenario.

I have a WordPress-based membership (WooCommerce, WooCommerce Subscriptions, WP Fusion, etc, etc). I also sell products. At a high level, my customers are either a) regular customers who chose to create an optional account when they placed their order or b) members, who signed up for my membership. A contact can also be both (customer and member).

My subscribers have a WordPress role of Subscriber. My Discourse forums are on a subdomain and I have the WordPress SSO working fine. But it’s the approval I am unclear about.

As much a possible, I want to manage access to the forum automatically, namely when someone signs up for my membership they can access my forum without any need for me to approve them. Importantly, if they are just a regular customer (no membership) I do NOT want them to be approved - this should only happen for subscribers.

Also, when someone cancels their membership I want their access to the forum to be automatically revoked.

Is all this feasible and, if so, what are the key principles I should research and test?

Thank you.

PS: I’m thinking webhooks, but perhaps I don’t need to go down that path,

1 Like

If you’re comfortable editing functions.php, searching for woo membership here should get you what you need to know. It takes some custom work to align your memberships with the discourse groups.

4 Likes

Have a look at How to prevent some WP users from being able to login to Discourse.

2 Likes

Thank you @pfaffman and @simon for your responses. It does look like I will be able to work something out here, in terms of full automation.

Given that I plan to launch soon and have a bunch of things to do for that I suspect I will end up going with some sort of bulk approval for my members (still need to check into the mechanics of that). Then, as new members come onboard I will manually approve, declining any requests that are not from members.

Thereafter I can dig down a little more on updating my plugin so I can integrate more tightly and automatically. My volume is sufficiently low for now that this shouldn’t be an issue in the short term.

Thanks again.

1 Like