Auto actions

8 years 11 months ago #263786 by marketsetc
Auto actions was created by marketsetc
Cannot seem to remove registered user group from a user if the user is enrolled in a premium plan. So premium users are in two usergroups.

Trigger is OnUserLogin. I'd actually prefer it be done on a cronjob.

Please Log in to join the conversation.

8 years 11 months ago #263789 by krileon
Replied by krileon on topic Auto actions
You've CBSubs controlling usergroups, but you want it to remove the previous usergroup? CBSubs won't do that unless the previous usegroup is also being controlled by a plan that has become inactive. The alternative is to act on the CBSubs subscription states using CB Auto Actions and let CB Auto Actions handle the usergroups. You can do this by using the following.

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

Now you can use the Usergroup action and replace, add, or remove usergroups as needed.


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 to join the conversation.

8 years 11 months ago - 8 years 11 months ago #263837 by marketsetc
Replied by marketsetc on topic Auto actions
Three quick questions: CBSubs is already configured to move expired memberships to register; is the second auto-action necessary?

And, the [var3] is hardcoded to refer to plan ID, correct? Likewise [var2] is intended to show active or inactive by A and X respectively?

Finally, once this is done, I can just run the auto action to clean everything up--is that right?

Thank you

Please Log in to join the conversation.

8 years 11 months ago #263841 by krileon
Replied by krileon on topic Auto actions

CBSubs is already configured to move expired memberships to register; is the second auto-action necessary?

I wouldn't combine the 2 usages. User CB Auto Actions or CBSubs to control usergroups. I don't recommend trying to use both at the same time.

And, the [var3] is hardcoded to refer to plan ID, correct? Likewise [var2] is intended to show active or inactive by A and X respectively?

Yes.

Finally, once this is done, I can just run the auto action to clean everything up--is that right?

No, those triggers are fired when their subscription state changes. It'd all be automated when someone subscribes or expires.


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: marketsetc

Please Log in to join the conversation.

8 years 9 months ago #267064 by marketsetc
Replied by marketsetc on topic Auto actions
This has never worked for me.

In new auto actions I was not able to enter in code of onCPayUserStateChange. I have some free plans, so I tried using before login as a trigger. Still will not remove usergroup Registered.

Please Log in to join the conversation.

8 years 9 months ago - 8 years 9 months ago #267072 by krileon
Replied by krileon on topic Auto actions
If you're using free lifetime plans then ensure you've configured free lifetime plans to create subscriptions within CBSubs > Settings > Global otherwise that trigger won't fire for them as they won't have a subscription state to act on. You also need to change PLAN_ID_HERE to the actual plan id, which is the number under the ID column in CBSubs > Plans and not the number under #. So for example if you had a plan with an ID of 4 you'd have exactly the below.

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

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

The above trigger is in the dropdown as "User State Change". Just start typing it and it should filter the dropdown to it.


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 to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.239 seconds