Skip to Content Skip to Menu

Search Results (Searched for: Triggers:)

  • krileon
27 Mar 2025 18:13
Replied by krileon on topic CbSubs urgent issue

So if these fields are filled, then we do not need mandatory or not-mandatory activation right?

Correct, it should still calculate tax based off location as long as cb_subs_inv_address_country is filled. There's no internal checks that I can see that mandate the invoice address to be enabled. It's just entirely checking those profile fields directly. So how those fields get filled can be entirely up to you. You could for example completely turn off the invoice address fields and populate cb_subs_inv_address_country from your own field using CB Core Fields Ajax.

Can you please advise regarding the creation of auto action?

Is onCPayBeforeDrawSubscription a good trigger for this?

I'd probably just do them during registration and profile edit to synchronize them when necessary. For existing users you can just run a 1 time database query to synchronize them and then future profile edits/registrations will always synchronize. The below should work fine for this.

Global
Triggers: onAfterUpdateUser, onAfterUserUpdate, onAfterUserRegistration, onAfterNewUser
Type: Field
User: Automatic
Access: Everybody
Conditions
Field: Custom > Value
Custom Value: [var1_YOUR_FIELD_HERE]
Operator: Not Equal To
Value: [var3_YOUR_FIELD_HERE]
Action
Field: cb_subs_inv_address_country
Operator: Set
Value: [YOUR_FIELD_HERE]

Replace YOUR_FIELD_HERE with the name of your country field (e.g. cb_country). The condition is to ensure it only synchronizes when that field changes as you don't want to do saves when not necessary. The above covers both frontend and backend registrations and user edits.

As for the query to quickly 1 time synchronize everyone the below should work. Be sure to replace PREFIX_ with whatever your database table prefix is.
Code:
UPDATE `PREFIX_comprofiler` SET `cb_subs_inv_address_country` = `YOUR_FIELD_HERE`

Now just turn off invoice address entirely and you're done. You won't have to bother your users for that during payments as it'll just use their profile field for it. If you need to synchronize more than country let me know and can provide adjustments to the above auto action to cover multiple fields, but in short you'd add OR conditions for those other fields to check for value changes then under Action add more field rows for them.
  • krileon
28 Feb 2025 17:42
Replied by krileon on topic email notifications
Ok, this is now available in latest CB Activity build release. It's now possible to act on an existing notification getting new recipients. This behavior is common with grouped notifications like profile.%.login notifications for example. Below is the usage I'd recommend.

Global
Triggers: activity_onAfterNotificationEntityStore, activity_onAfterNotificationEntityUpdate
Type: Email
User: Code
Access: Everybody
User
Code:
if ( ! $variables['var2']->getPublished() ) { return; } if ( $variables['var3'] === false ) { return; } if ( $variables['var3'] === true ) { return $variables['var2']->getRecipients(); } if ( is_array( $variables['var3'] ) ) { return $variables['var3']; }

The rest of your auto action should be able to remain the same. Added some logic for var3 since for Store it's going to be TRUE for a new notification otherwise FALSE if the notification itself was modified. For Update var3 will always be a recipient diff so you'll only send emails for new recipients.
  • krileon
24 Feb 2025 18:37
Replied by krileon on topic Questions on CBSubs -Gateway and AcyMailing
Awesome, glad to hear it! If you do end up needing to use CB Auto Actions for custom subscription status behavior the below will get you started.

Plan Active
Global
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditions
Condition 1
Field: Custom > Value
Custom Value: [var3]
Operator: Equal To
Value: PLAN_ID_HERE
Condition 2
Field: Custom > Value
Custom Value: [var2]
Operator: Equal To
Value: A

Plan Expired
Global
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditions
Condition 1
Field: Custom > Value
Custom Value: [var3]
Operator: Equal To
Value: PLAN_ID_HERE
Condition 2
Field: Custom > Value
Custom Value: [var2]
Operator: Not Equal To
Value: A

Simply replace PLAN_ID_HERE with the ID of the plan you want to act on and you're good to go. You can do pretty much whatever you like from here. Run custom queries, run custom PHP, use any of the many included action types, etc.. We've very few hard limits throughout our plugins as we provide A LOT of triggers to act on for inserting custom logic cleanly.
  • krileon
24 Feb 2025 18:26
You can have users conditionally auto join groups using CB Auto Actions. The below should work fine for this.

Global
Triggers: onAfterUserRegistration
Type: CB GroupJive
User: Automatic
Access: Everybody
Conditions
Supply whatever conditions you like here!
Action
Mode: Join Groups
Groups: SUPPLY_GROUPS_HERE
Status: Member

That's all you should need to do. Now when a user registers that matches your conditions they'll be placed in the supplied groups. If you need this to act on a CBSubs plan subscription status change then you can use the following.

Global
Triggers: onCPayUserStateChange
Conditions
Condition 1
Field: Custom > Value
Custom Value: [var3]
Operator: Equal To
Value: PLAN_ID_HERE
Condition 2
Field: Custom > Value
Custom Value: [var2]
Operator: Equal To
Value: A

Replace PLAN_ID_HERE with the ID of the plan you want this to condition off of and any additional conditions you like.

As a general FYI you can use the below in CB Auto Actions to run ANY custom behavior you like on subscription status changes. These are the same triggers and behavior the CBSubs integrations are using. This provides effectively unlimited potential for subscription driven logic.

Plan Active
Global
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditions
Condition 1
Field: Custom > Value
Custom Value: [var3]
Operator: Equal To
Value: PLAN_ID_HERE
Condition 2
Field: Custom > Value
Custom Value: [var2]
Operator: Equal To
Value: A

Plan Expired
Global
Triggers: onCPayUserStateChange
User: Automatic
Access: Everybody
Conditions
Condition 1
Field: Custom > Value
Custom Value: [var3]
Operator: Equal To
Value: PLAN_ID_HERE
Condition 2
Field: Custom > Value
Custom Value: [var2]
Operator: Not Equal To
Value: A
Displaying 31 - 34 out of 34 results.
Powered by Kunena Forum