Skip to Content Skip to Menu

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

CB Auto Actions Trigger Explanation

8 years 2 months ago - 8 years 2 months ago #284737 by Intellitech
CB Auto Actions Trigger Explanation was created by Intellitech
Hi Developers!

Just wondering if you have a reference list/guide to briefly explain the Trigger actions?

For example, what is the difference between onAfterSaveUserRegistration vs onAfterUserRegistration??
or onAfterUserUpdate vs onAfterProfileSaved?

The list of Trigger has many new and similar ones to the former ones which I am familiar with.
It would be good understand the differences, so that I can know which Triggers to use and set the Auto Actions accordingly

Appreciate it.

Thank you.
Last edit: 8 years 2 months ago by Intellitech. Reason: additional query on triggers

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48457
  • Thanks: 8280
  • Karma: 1443
8 years 2 months ago #284757 by krileon
Replied by krileon on topic CB Auto Actions Trigger Explanation

Just wondering if you have a reference list/guide to briefly explain the Trigger actions?

Beyond the below, nope.

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

Triggers are location dependent. I don't think we'll ever be able to properly document them as there's just too many for us to maintain that kind of information. Best way to understand how a trigger works is to find it. In short make an IDE (e.g. in phpstorm, netbeans, eclipse, etc..) project out of your Joomla directory then search for that trigger.

Which trigger you use is more dependent on what you're wanting to do and I'll be happy to advise you what the most appropriate trigger would be if you provide a usecase.


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 or Create an account to join the conversation.

8 years 2 months ago #284769 by Intellitech
Replied by Intellitech on topic CB Auto Actions Trigger Explanation
Could you confirm if onAfterUserUpdate = from user end, and onAfterUpdateUser = from the Administrator end?
I do not recall the former naming convention identifying the triggers were named this way. It was something like ProfileFrontend or ProfileBackend, that helped to easy identify which should be selected based on front or backend updates.

Anyway, here are the various scenarios -
Scenario 1 - User signs up first time and trigger emails to user-end and administrator of site [Resolved using onAfterUserRegistration]

Scenario 2 - Administrator processes and Approves new user [Would using the new Auto Welcome plugin to trigger a welcome email work?]

Scenario 3 - Registered User logs into Update Profile. Requires to trigger emails to User and Admin. (Note: we are using this process to track renewals as well as a form of application to a panel if the user is of a certain category of membership). [what trigger should be used for this?]

Scenario 4 - Administrator Updates and approves (via a field selection) of the status to the panel application. It should then fire an email to the User informing them of the outcome of their application. Outcome could be approved or rejected. [what trigger should be used for this?]

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48457
  • Thanks: 8280
  • Karma: 1443
8 years 2 months ago #284776 by krileon
Replied by krileon on topic CB Auto Actions Trigger Explanation

Could you confirm if onAfterUserUpdate = from user end, and onAfterUpdateUser = from the Administrator end?

Yes, that's correct.

Scenario 2 - Administrator processes and Approves new user [Would using the new Auto Welcome plugin to trigger a welcome email work?]

If you're wanting to act on approval use onAfterUserApproval (works in frontend and backend). Aside from that you need to be more specific as to when you're wanting to send an email. Approving a user will automatically send the Welcome email configured in CB > Configuration > Registration.

Scenario 3 - Registered User logs into Update Profile. Requires to trigger emails to User and Admin. (Note: we are using this process to track renewals as well as a form of application to a panel if the user is of a certain category of membership). [what trigger should be used for this?]

Trigger an email when? When they update their profile? When they login? or when they visit profile edit?

Scenario 4 - Administrator Updates and approves (via a field selection) of the status to the panel application. It should then fire an email to the User informing them of the outcome of their application. Outcome could be approved or rejected. [what trigger should be used for this?]

If it's just user approval you can use onAfterUserApproval. Need more details to suggest anything further.


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 or Create an account to join the conversation.

8 years 2 months ago #284788 by Intellitech
Replied by Intellitech on topic CB Auto Actions Trigger Explanation

Further explanation/details of our process below -

Scenario 2 - Administrator processes and Approves new user [Would using the new Auto Welcome plugin to trigger a welcome email work?]
If you're wanting to act on approval use onAfterUserApproval (works in frontend and backend). Aside from that you need to be more specific as to when you're wanting to send an email. Approving a user will automatically send the Welcome email configured in CB > Configuration > Registration.

Does this mean that, even if I do not use the "onAfterUserApproval" from in Auto Actions, the Welcome email set in the Configuration will default be the one that will be sent. I'd just want the email to be sent after user has been set to Approved to send the Welcome email to let them know they can access the site.

Scenario 3 - Registered User logs into Update Profile. Requires to trigger emails to User and Admin. (Note: we are using this process to track renewals as well as a form of application to a panel if the user is of a certain category of membership). [what trigger should be used for this?]
Trigger an email when? When they update their profile? When they login? or when they visit profile edit?

Trigger when an update is done to their profile.

Scenario 4 - Administrator Updates and approves (via a field selection) of the status to the panel application. It should then fire an email to the User informing them of the outcome of their application. Outcome could be approved or rejected. [what trigger should be used for this?]
If it's just user approval you can use onAfterUserApproval. Need more details to suggest anything further.

Ok, scenario is this - if users are in membership category "X", they are eligible to complete other fields [configured using tab conditionals] in the profile to be on a panel. Their "application" to this panel is subject to approval. Only when the admin indicates their appointment (using a selection field criteria) to the panel, then this email informing them of their appointment will be sent. Reason that we are using the tab conditions to add the extra fields to capture this "second" application in the Profile Update, is because we require the existing information to access if the user is eligible to be appointed. in this case, should the Trigger be onAfterUpdateUser?


Basically I'm looking from the perspective of the Admin user end - which triggers to set when from the user details are being Saved from the Backend.
And also from the Front user end - which triggers to set when the user updates from the front.

I believe in the previous version, the Triggers were broken into Frontend and Admin Backend for selection. The newer version does not quite identify which trigger is executed if from the Frontend or Backend.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48457
  • Thanks: 8280
  • Karma: 1443
8 years 2 months ago #284799 by krileon
Replied by krileon on topic CB Auto Actions Trigger Explanation

Does this mean that, even if I do not use the "onAfterUserApproval" from in Auto Actions, the Welcome email set in the Configuration will default be the one that will be sent. I'd just want the email to be sent after user has been set to Approved to send the Welcome email to let them know they can access the site.

The Welcome email already does this. I see no reason to try replacing it with CB Auto Actions usage.

Trigger when an update is done to their profile.

You'd just act on onAfterUserUpdate with an Email action then.

Ok, scenario is this - if users are in membership category "X", they are eligible to complete other fields [configured using tab conditionals] in the profile to be on a panel. Their "application" to this panel is subject to approval. Only when the admin indicates their appointment (using a selection field criteria) to the panel, then this email informing them of their appointment will be sent. Reason that we are using the tab conditions to add the extra fields to capture this "second" application in the Profile Update, is because we require the existing information to access if the user is eligible to be appointed. in this case, should the Trigger be onAfterUpdateUser?

Ok, so you've a field you set as an administrator to approve the application. In that case you'd act on onAfterUserUpdate and condition against that field in an Email action. If you're doing this from backend you need to use onAfterUpdateUser (or both if you want to support both locations).

Basically I'm looking from the perspective of the Admin user end - which triggers to set when from the user details are being Saved from the Backend.
And also from the Front user end - which triggers to set when the user updates from the front.

Frontend = onAfterUserUpdate
Backend = onAfterUpdateUser

Their location somewhat noticeable due to their wording "After User Update" and "After Update User". They key change being User and Update swap changing their meaning significantly.

I believe in the previous version, the Triggers were broken into Frontend and Admin Backend for selection. The newer version does not quite identify which trigger is executed if from the Frontend or Backend.

Correct, that's now gone and no plans to return. I encourage everyone to simply learn the triggers if you intend to use CB Auto Actions extensively. Most are obvious, but some of the older triggers maybe a little confusing about their usage or location. Newer triggers will always be clear as to what they're doing and where.


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 or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum