Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

Add subscriber to 2 groups

  • endoc
  • endoc
  • OFFLINE
  • Posts: 96
  • Thanks: 5
  • Karma: 0
9 years 6 months ago - 9 years 3 months ago #262041 by endoc
Add subscriber to 2 groups was created by endoc
What would be the simplest way to add a user to two groups (via CBSubs) upon subscription to a plan? Likewise, remove the user from both groups after the plan expires?
Last edit: 9 years 3 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48474
  • Thanks: 8281
  • Karma: 1443
9 years 6 months ago #262097 by krileon
Replied by krileon on topic Add subscriber to 2 groups
You'll need CB Auto Actions for that as CBSubs can only manage a single group per plan at this time. To get started you'd setup your action with either of the following as needed.

Plan Active
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditional 1: [var3] Equal To PLAN_ID_HERE
Conditional 2: [var2] Equal To A

Plan Expired
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditional 1: [var3] Equal To PLAN_ID_HERE
Conditional 2: [var2] Equal To X

Replace PLAN_ID_HERE with the ID of the plan you want the action to act on.

With the above you can use whatever action you want. So in your case the Usergroup action. You'd have 2 actions 1 for adding your usergroups on plan active and 1 for removing on plan expired.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: endoc

Please Log in or Create an account to join the conversation.

  • endoc
  • endoc
  • OFFLINE
  • Posts: 96
  • Thanks: 5
  • Karma: 0
9 years 6 months ago #262327 by endoc
Replied by endoc on topic Add subscriber to 2 groups
Thank you!
The following user(s) said Thank You: nant

Please Log in or Create an account to join the conversation.

  • endoc
  • endoc
  • OFFLINE
  • Posts: 96
  • Thanks: 5
  • Karma: 0
9 years 3 months ago #267135 by endoc
Replied by endoc on topic Add subscriber to 2 groups
Sorry to reopen a past topic. Now that the time has come to use this feature, I see that the auto action does not appear to be effective. When a user subscribes to a new plan, it does not seem to add the user to the additional user group.

I've posted the admin side screen shots for each tab of Auto Action plugin.

Will you check to see if it is configured properly?

Thank you!
Attachments:

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48474
  • Thanks: 8281
  • Karma: 1443
9 years 3 months ago - 9 years 3 months ago #267157 by krileon
Replied by krileon on topic Add subscriber to 2 groups
Ensure you're not trying to give the user a subscription using your plan as well. If CBSubs and CB Auto Actions are both trying to control the usergroup assignment then CBSubs will win as it does it after that trigger. You have to use one or the other.

Also note this won't work when giving a subscription to a user from backend as the user store happens after the trigger is fired so user store will override the change in which case just select the usergroup manually during edit.

If your plan is free lifetime ensure free lifetime plans are configured to generate subscriptions within CBSubs > Settings > Global otherwise there's no subscription state to condition off of.

Please also ensure you've latest CB 2.x nightly below and latest CB Auto Actions 6.3.1.

www.joomlapolis.com/downloads/doc_details/640-community-builder-nightly-build


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Last edit: 9 years 3 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • endoc
  • endoc
  • OFFLINE
  • Posts: 96
  • Thanks: 5
  • Karma: 0
9 years 3 months ago #267308 by endoc
Replied by endoc on topic Add subscriber to 2 groups
Thank you for your reply.

The plan is not a free or lifetime plan. After the user pays, it does successfully assign them to a user group, as defined in CB Subs > 'Plan' > Access > User Group. I would like to have it also assign them to an additional (unrelated) group. It is this second assignment that I am having trouble with.

I was using CB Auto Actions 6.0.1, but it hasn't made a difference after upgrading. I'm also current on the nightly build.

The Auto Actions don't seem to take effect after front-end subscriptions.

Any other ideas?

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum