Skip to Content Skip to Menu

Auto action usecase

  • liaskas
  • liaskas
  • OFFLINE
  • Posts: 391
  • Thanks: 36
  • Karma: 2
  • Add-ons
3 years 1 week ago #327079 by liaskas
Auto action usecase was created by liaskas
Hello

Some of our users have 2 subscription plans at the same time. So we need the auto action to work only if the user does not have some concurrent subscription activated.

Example:

User has 2 subscriptions activated.
Plan A with ID 1
Plan B with ID 2

Both plans add this user to user group "paid member".

Plan B expires. The user is removed from "paid member" user group, even if he has Plan A activated and he should be a "paid member".

We tried the following auto action but it does not do the job. Can you please advise?

Triggers: onCPayUserStateChange
Type: Usergroup
Access: Everybody

Conditions...

Field: Value
Custom Value: [var3]
Operator: Is Not In
Value: 1

Field: Value
Custom Value: [var2]
Operator: Not Equal To
Value: A

Action...

Remove Usergroups
Groups: paid member

Thank you

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
3 years 1 week ago - 3 years 1 week ago #327098 by krileon
Replied by krileon on topic Auto action usecase
onCPayUserStateChange only includes the plan being subscribed to and the subscription resulting from that plan. So you can't use variables from that trigger to condition like what you're wanting. However this will be possible with CB Auto Actions 9.0.0. Currently 9.0.0 is planned to release tomorrow. It includes a new condition specifically for conditioning against subscription status. Below is a screenshot of what this looks like.



This would allow you to check if either of the plans are still active in your auto action that removes them from the usergroup. So you'd have 1 auto action for adding the usergroup and 1 for removing it basically.


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: 3 years 1 week ago by krileon.

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

  • liaskas
  • liaskas
  • OFFLINE
  • Posts: 391
  • Thanks: 36
  • Karma: 2
  • Add-ons
3 years 1 week ago #327105 by liaskas
Replied by liaskas on topic Auto action usecase
Thank you Krileon

Will test things tomorrow then with the new version.

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

  • liaskas
  • liaskas
  • OFFLINE
  • Posts: 391
  • Thanks: 36
  • Karma: 2
  • Add-ons
3 years 1 week ago - 3 years 1 week ago #327119 by liaskas
Replied by liaskas on topic Auto action usecase
Ok... latest Auto Actions plugin is installed

We set...
Triggers: onCPayUserStateChange
Type: Usergroup
Access: Everybody

Conditions...

Field: Subscriptions
User: Action User
Plans: Plan A
Status: Expired

for the usergroup removal.

How will we set that the removal will happen only if there is no other subscription Plan active?

For example, if a user has Plan A and Plan B activated, we do not want the usergroup removal to take place when one of the two plans expires!

Please advise...

Thank you.
Last edit: 3 years 1 week ago by liaskas.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
3 years 1 week ago #327120 by krileon
Replied by krileon on topic Auto action usecase
Conditions are conditions for the auto action to execute. In this case you've selected for Plan A to be Expired. If Plan A is NOT Expired the auto action will not execute.


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.

  • liaskas
  • liaskas
  • OFFLINE
  • Posts: 391
  • Thanks: 36
  • Karma: 2
  • Add-ons
3 years 1 week ago #327121 by liaskas
Replied by liaskas on topic Auto action usecase
Forgive me for bothering you all the time... probably i was not clear enough on what we need!

We need a condition that will execute only if there is no other subscription active.

For example, if a user has Plan A and Plan B activated, we do not want the usergroup removal to take place when one of the two plans expires and the other remains active!

We want the action to execute when the user does not have any concurrent subscriptions.

I thought from your first reply to this topic that this was possible. How can this be done? Can you please propose some conditions settings?

Please advise...

Thank you.

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

Moderators: beatnantkrileon
Powered by Kunena Forum