Business Manager Alerts

Salesforce Commerce Cloud PRO Tips

Hi guys! and Welcome to another Chapter of the Salesforce Commerce Cloud Pro Tips series.

This time I want to talk about the Business Manager custom Alerts. Did you know that you can create custom alerts to notify the merchants or instances administrators that something happened an their attention is needed?

Is your job as developer usually interrupted by urgent messages…

  • To check if a product is out of stock?
  • To verify if a a promotion is about to end?
  • or to check why no orders have been received during some period of time?

Probably it’s time to write some code to liberate your job and to take advantage of Salesforce Commerce Cloud Alerts. To view alerts just enter in the Business Manager and click the bell in your top right corner. You can click show all to expand the Alerts. By default there are alerts defined by Salesforce but you can create your own using the alert API package.

All you need to do is use this API and define your alerts in a custom cartridge added to the Business Manager Cartridge Path.

Things you need to do to create custom Alerts are:

  1.  Create a custom cartridge that is added to the Business Manager Cartridge Path.
  2. You need to define the Custom Alerts in the package.json file inside your custom cartridge. As you can see here there is an alert definition. This path is relative to the package.json file and the JSON file looks like this.
  3. Localize alert messages. message-resource-id this message ID is under the templates/resources/alert.properties file the message and the description this match exactly with the message that we are seeing here and that’s it.
  4. Create alerts using the dw.alert.Alerts class.

In this example the alerts are created by a job that its scheduled every 60 minutes and the script in the job just do some verifications we need to do in order to see if an alert is needed to be created or not.

How to be a Certified Salesforce Commerce Cloud Developer for FREE

Unlock a FREE PDF with SFCC B2C Certification questions from our Udemy Course. Join our newsletter!
Check your email, you’ll receive a copy in a few seconds. If you don’t see it, please check your spam folder.

Do you like cookies? 🍪 We use cookies to ensure you get the best experience on our website. Learn more.