Autoaction for CBSubs ?

4 years 3 months ago #316317 by rbuelund
Autoaction for CBSubs ? was created by rbuelund
Is it possible to trigger an autoaction if a certain plan is set to active on a user, and trigger another action if that same plan is set to inactive ?

Please Log in to join the conversation.

4 years 3 months ago #316324 by krileon
Replied by krileon on topic Autoaction for CBSubs ?
Yup, use the below to do that.

Plan Active
Global
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditions (custom value conditions)
1: [var3] Equal To PLAN_ID_HERE
2: [var2] Equal To A

Plan Expired
Global
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditions (custom value conditions)
1: [var3] Equal To PLAN_ID_HERE
2: [var2] Not Equal To A

Replace PLAN_ID_HERE with the ID of the plan you want this to act on.


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.

4 years 3 months ago #316325 by rbuelund
Replied by rbuelund on topic Autoaction for CBSubs ?
Ok - so like in the image here: ?
Attachments:

Please Log in to join the conversation.

4 years 3 months ago #316326 by rbuelund
Replied by rbuelund on topic Autoaction for CBSubs ?
Yep - works perfectly. Thanks.

Is there anywhere where one can see an explanation of those [var2], [var3] ... values ?

Please Log in to join the conversation.

4 years 3 months ago #316327 by rbuelund
Replied by rbuelund on topic Autoaction for CBSubs ?
I would also like to be able to trigger some code if the subscription of a plan has run out (all the users have a plan that runs out by the calendar year) - a little like the CBSubs mailer - how could I do that? It is for sending SMS messages to users who have not paid the plan in time at the begining of the next year/period - so I have to loop through the respective users and then trigger my PHP script that sends SMS messages.

Please Log in to join the conversation.

4 years 3 months ago #316331 by krileon
Replied by krileon on topic Autoaction for CBSubs ?

Is there anywhere where one can see an explanation of those [var2], [var3] ... values ?

What variables are available depends on the trigger used so to an extent yes you can see what those are based off the trigger in the triggers documentation below.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18358-using-cb-triggers

We don't have a means of automating documenting triggers yet, but we've some ideas on how we're going to go about doing that so it'll be easier to look this information up.

I would also like to be able to trigger some code if the subscription of a plan has run out (all the users have a plan that runs out by the calendar year) - a little like the CBSubs mailer - how could I do that? It is for sending SMS messages to users who have not paid the plan in time at the begining of the next year/period - so I have to loop through the respective users and then trigger my PHP script that sends SMS messages.

The "Plan Expired" usage above will fire if the plan is no longer active so it will cover that case. As for sending the SMS you can execute PHP using a Code action. There's no functionality like CBSubs Mailer in CB Auto Actions as it is not a scheduler; the best you could do in that regard is the Internal Users trigger then use the Internal Users URL in a CRON task, which would loop every user through an auto action but that won't have any information about the status of their subscription since that information is coming from the onCPayUserStateChange usages.


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.206 seconds

Facebook Twitter LinkedIn