CBSubs Autoaction triggers ordering

4 years 2 months ago #316727 by agaudin
CBSubs Autoaction triggers ordering was created by agaudin
Hello

I want to manage internal emails (and probably other actions) once users have paid their subcription using CBSubs ; some of them will pay online using an external (third party) paiement connexion (with the appropriate CBSubs plugin) ; other ones will pay "offline" by sending a check. I need to understand th differences between all CBSubs Autoaction triggers - and the order / time they appear during the CBSubs sequence....

As an example, the trigger "OnAfterUserRegistration" (a clasical CBuilder trigger) doesn't let show the paiement details since registration process occurs before paiement. The CBSubs "onCPayAfterPaiementStatutsChange" will be called several times (I think) when paying online. Etc.

Which trigger(s) could be called (the latest possible in the process, but called just once at the end) ? Or do you have a piture to get wht an when CBSubs triggers act ?

Thanx by advance

Regards

Antoine

Please Log in to join the conversation.

4 years 2 months ago #316732 by krileon
Replied by krileon on topic CBSubs Autoaction triggers ordering
For registration onAfterSaveUserRegistration is fired just before the registration complete message is displayed. The triggers variables are as follows.

$_PLUGINS->trigger( 'onAfterSaveUserRegistration', array( &$userComplete, &$messagesToUser, 1 ) );

var3 (the 1) is noting this is a frontend registration. As for CBSubs it's best to use the below usage to act only when plan has been activated or deactivated.

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.
The following user(s) said Thank You: agaudin

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.169 seconds

Facebook Twitter LinkedIn