I want to share what I figured out, when I looked for a solution, why my trigger for expired plans (manually via backend) not fired and removes a user from a group.
I read a lot of threads and various descriptions and solutions, but no solution for my case.
My Env.:
CB 2.0.13, CB Subs 4.0.1, GJ 3.0.1
2 top level plans. One live time for free (default, without record creation), one upgrade subscription plan (not free).
One GJ group for upgraded subscriber
2 Auto Actions like this from Kyle:
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
My Problem:
Automatic assignment to group by the first trigger worked fine also when I do a manually upgrade in backend. But removal didn't work when I canceled manually.
Solution:
I saw in backends logs that status before terminating the subscription was A and after was C (not X!). Also if I use the Delete methode. So I think additionally to the X we simply need a C. Then it should work in front- and backend, respectively when expired by time.
My Expired Trigger now locks like that:
Plan Expired
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditional 1: [var3] Equal To PLAN_ID_HERE
Conditional 2: [var2] Is REGEX {[XC]}
@Kyle, this solutions seems to work for me. Could you confirm this way?
Did I use the right syntax with the curved brackets "{" or does that work for me by blind chance?
Plan Active Global
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody Conditions
1: [var3] Equal To PLAN_ID_HERE
2: [var2] Equal To A
Plan Expired Global
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody Conditions
1: [var3] Equal To PLAN_ID_HERE
2: [var2] Not Equal To A
Specifically the expiration case handles everything except active so it should take care of cancelled and expired states fine.
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: nant, schrammelmann