Skip to Content Skip to Menu

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

[SOLVED] Remove user from gj group when plan expired/canceled with auto action

8 years 7 months ago - 8 years 5 months ago #279355 by schrammelmann
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?

Thanks,
Michael
Last edit: 8 years 5 months ago by krileon.

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

8 years 7 months ago #279999 by schrammelmann
It seemed to work, but it doesn't.

When users subscribe to a plan, trigger "onCPayUserStateChange" was not fired or quite another matter prevent user joined to the specified gj group.

I updated to CB 2.0.14 and CBSubs 4.0.2.
Native GJ integration in CBSubs seems to be fixed and works fine now.

I removed both auto actions.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48459
  • Thanks: 8280
  • Karma: 1443
8 years 5 months ago #282017 by krileon
The below usage should work.

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

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

8 years 5 months ago #282112 by schrammelmann
Thank you Kyle!

I've tested with CB 2.0.14, CBSubs 4.1.0 and CB GroupJive 3.0.1. GJ Membership toggling works well.

Tested manually as admin in backend and as user in frontend using paypal processor and payment refund.

Not tested: automatic expiration. (but sure this works proper too :-)

I think it could be set to solved.

Thanks,
Michael
The following user(s) said Thank You: krileon

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

Moderators: beatnantkrileon
Powered by Kunena Forum