Triggers
Last updated
Last updated
The CodeMash Membership module includes a " Triggers " feature that allows you to specify actions to be taken when certain events occur within the app. These events can include user actions such as registering, verifying, or deactivating their account and other relevant events to your app.
When activated, a trigger can perform various actions, such as sending notifications, calling serverless functions, or calling other APIs. This can be useful for automating your app's tasks and processes and providing a more seamless and efficient user experience.
You can use the "Triggers" feature in the CodeMash Membership module to specify actions to be taken when certain events occur within your app. This can be useful for automating tasks and processes and for providing a more seamless and efficient user experience for your users.
Here is a screenshot of a trigger in the CodeMash Membership module that sends an email to the app administrators with information about a new user who has registered for an account:
Below, we will provide more information about each field on this screen:
Enabled: This checkbox determines whether the trigger is enabled and can be called. The trigger is enabled and can be called if the checkbox is checked. If it is not checked, the trigger is disabled and will not be called.
Name: This is the name of the trigger. You can give it a descriptive name to help you identify it later.
Trigger On: is used to specify the events that will trigger the action to be taken. Here is a list of those events, along with a brief description of each:
On Register: this trigger is activated when a user registers for an account in your app.
On Invite: this trigger is activated when a user is invited to join your app, either by you or by another user.
On Verified: this trigger is activated when a user's account is verified, either automatically or manually.
On Update: this trigger is activated when users update their account information, such as their name or email address.
On Delete: this trigger is activated when a user's account is deleted.
On Deactivate: this trigger is activated when a user's account is deactivated.
On Reactivate: this trigger is activated when a user's account is deactivated.
Action Type: field in the CodeMash Membership module is used to specify the action that will be taken when a trigger is activated. There are several types of actions that can be taken, including:
Send Email: This action sends an email to specified email addresses.
Send Notification: This action sends a push notification to the devices of one or more users.
Call Function: This action calls a serverless function or code that you have defined within your app or project.
Call API: This action calls another API. (under development)
Execution order: when multiple triggers are activated simultaneously, they will be executed in the order specified by the "Execution Order" field. This means that each trigger will be executed after the previous trigger has completed its action. This allows you to control the order in which actions are taken within your app, and to ensure that they are performed in the desired sequence.
The last section of fields in the CodeMash Membership module's "Triggers" feature is dynamic and depends on the chosen action type. This means that the fields in this section will change depending on the selected action type, and you can find more detailed information about these fields in the "Other Topics" documentation under the "Triggers" section.