Skip to Content Skip to Menu

CBSubs remove and add user groups when plan expire or reactivate

10 years 11 months ago - 10 years 11 months ago #239747 by deltafidesign
Hi,

I have a commercial Plan A where user are assigned to usergroup A

When Plan A expires I want that usergroup A is no longer assigned to those users and they are assigned to usergroup B till they reactivate the Plan A. After renewing Plan A, usergroup assigned become again A and they are removed from usergroup B.

To do this I've created 3 autoactions:

1 - remove from usergroup A:

Type: Usergroup
Triggers: onCPayUserStateChange
Access: Everybody
Conditional 1: [var3] Equal To PLAN_ID
Conditional 2: [var2] Not Equal To A
Mode: Remove Usergroup
Groups: usergroup A


2 - Assign to usergroup B:

Type: Usergroup
Triggers: onCPayUserStateChange
Access: Everybody
Conditional 1: [var3] Equal To PLAN_ID
Conditional 2: [var2] Not Equal To A
Mode: Add Usergroup
Groups: usergroup B



3 - Remove from usergroup B after Plan A reactivated

Type: Usergroup
Triggers: onCPayUserStateChange
Access: Everybody
Conditional 1: [var3] Equal To PLAN_ID
Conditional 2: [var2] Equal To A
Mode: Remove Usergroup
Groups: usergroup B


Is that correct?
Last edit: 10 years 11 months ago by deltafidesign.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48680
  • Thanks: 8313
  • Karma: 1446
10 years 11 months ago #239792 by krileon

Is that correct?

I suppose so. Using CB Auto Actions is strictly about trial and error. Test it and see if it works as expected. The conditions and the triggers all look correct, but I don't see anything adding Usergroup A.


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.

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

10 years 11 months ago #239804 by deltafidesign
I didn't created the auto action to add to usergroup A because I supposed that after Plan A reactivation it assign it to usergroup A as I setted it into Plan A for group assign option. Right? Or should I create anyway the auto action?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48680
  • Thanks: 8313
  • Karma: 1446
10 years 11 months ago #239832 by krileon
Well if you've CBSubs adding Usergroup A it'll also likely remove it when the plan expires. So you should only need to manage Usergroup B with your actions and let the plan take care of Usergroup A.


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.

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

10 years 11 months ago #239865 by deltafidesign
Ok something should be wrong at this point because I did it 'cause I noticed that a plan for a user was expired but the assigned group was not removed.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48680
  • Thanks: 8313
  • Karma: 1446
10 years 11 months ago #239867 by krileon
Maybe a bug or maybe due to the users usergroups being altered. As long as everything is working fine between CBSubs and your 3 actions I suggest continuing with that usage.


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.

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

Moderators: beatnantkrileon
Powered by Kunena Forum