Automating Clarity’s Distributor Notifications
So far, Clarity’s distributor management app has no automated notifications for entry events. This means administrators must check the object to learn of new submissions and inform applicants on the status of their applications manually. This strategy doesn’t scale and leaves room for human error, resulting in missed opportunities or poor user experience. In these exercises, you’ll automate notifications to streamline communication Clarity's distributor onboarding process.
Exercise: Adding Notification Templates
Setting up notifications begins with defining notification templates. These templates serve as blueprints for your notifications, specifying the content, design, and delivery method. Once defined, you can then use the template for notification actions in an object definition.
Clarity needs four notification templates for their distributor management app:
Event | Recipient | Type |
---|---|---|
Application Submitted | User | |
Application Received | Applicant | |
Application Approved | Applicant | |
Application Denied | Applicant |
Here you’ll create these templates.
-
Open the Global Menu (
), go to the Control Panel tab, and click Templates under Notifications. -
Click Add (
) and select User Notification. -
Scroll down to Definition of Terms and use the Entity drop-down menu to select the Distributor Application object.
You can use these field references in the template to populate notifications dynamically with entry data. In the General Terms section are terms for referencing fields for the user that triggers the notification action. -
Scroll up to the Basic Info section and enter these values:
Field Value Name Distributor Application Submitted, Admin, User
Description Sends user notifications to an administrative role whenever a distributor application is submitted.
-
Enter these values for Settings:
Field Value Name Role Role Business Development Manager
Business Development Specialist
-
Enter this value for Content:
Field Value Subject APP-[%DISTRIBUTORAPPLICATION_ID%]: [%DISTRIBUTORAPPLICATION_APPLICANTNAME%] submitted a distributor application for [%DISTRIBUTORAPPLICATION_BUSINESSNAME%].
-
Click Save.
-
Open your terminal and go to the
client-extensions/liferay-clarity-batch-create-notification-templates/
folder in your course workspace. -
Run this command to deploy the batch client extension.
-
Verify it deploys successfully.
-
Verify three new email notification templates appear.
These templates provide email notifications to applicants, keeping them informed about the status of their applications.
-
Review the contents of each template.
With the templates in place, you can use them for object notification actions.
Exercise: Adding Notification Actions
Clarity wants to improve visibility for new applications. They also want to automate updates for applicants, notifying them when their application is received, approved, or denied. Here you’ll add these notification actions to the Distributor Application object.
-
Open the Global Menu (
), go to the Control Panel tab, and click Objects. -
Go to the Distributor Management folder and begin editing the Distributor Application object.
-
Go to the Actions tab and click Add (
). -
Enter these values in the Basic Info tab:
Field Value Action Label Application Submitted
Action Name applicationSubmitted
Description Notify the business development team of new distributor applications.
Active Yes -
Go to the Action Builder tab and set these values:
Field Value Trigger On After Add Condition N/A Action Notification Notification Template Distributor Application Submitted, Admin, User - Click Save.
- Repeat the above steps to create three more notification actions:
Field Value Action Label Application Received
Action Name applicationReceived
Description Notify applicants when their applications are received.
Active Yes Trigger On After Add Condition N/A Action Notification Notification Template Application Received, Applicant, Email Field Value Action Label Application Approved
Action Name applicationApproved
Description Notify applicants when their applications are approved.
Active Yes Trigger On After Update Condition applicationState == "approved" AND status == 0
Action Notification Notification Template Application Approved, Applicant, Email Field Value Action Label Application Denied
Action Name applicationDenied
Description Notify applicants when their applications are denied.
Active Yes Trigger On After Update Condition applicationState == "denied" AND status == 0
Action Notification Notification Template Application Denied, Applicant, Email - Verify the actions work by creating and resolving a new distributor application entry.
With these notification actions in place, Clarity's distributor management app now automatically notifies the relevant users at each stage of the application process.
Conclusion
Great! You’ve successfully implemented automatic notifications for Clarity’s distributor management app. These enhancements streamline communication and improve the user experience for Clarity's administrators and applicants. Next, you’ll explore how to use object actions to automate entry creation and updates.
Capabilities
Product
Education
Contact Us