Brightspot CMS Developer Guide
Brightspot CMS Developer Guide
Developer guide
Notifications

Notification lifecycle


Brightspot invokes the following process when processing notifications.

  1. An event occurs (e.g., a ToolUser publishes a Content).
  2. Create a publisher with all the message context information for the event (content ID, user ID, etc.)
  3. Invoke the publisher’s Publisher#publishNotification/Async method, which performs all of the following steps.
  4. Publisher fetches a list of all possible receivers by invoking Publisher#getReceivers.
  5. For each receiver:

    1. Fetch the set of subscriptions with Receiver#getReceiverSubscriptions.
    2. For each subscription:

      1. Check if the following are true:

        • Subscription matches the publisher’s generic type argument <S> in Publisher<S, C>.
        • Subscription#shouldDeliver(Receiver, C) returns true.

        If one of the tests fails, proceed to the next subscription.

      2. Build the list of delivery options with Subscription#getDeliveryOptions.
      3. For each delivery option:
        1. Fetch the delivery option’s list of message formatters by calling DeliveryOption#getMessageFormatters.
        2. Find the message formatters that match the current subscription and delivery option.
        3. For each message formatter:
          1. Attempt to format the MessageContext into the DeliveryOption<M>-specific message type <M> by calling MessageFormatter#format(MessageContext, D).
          2. If there are no valid message formatters, create a message from the subscription’s default HTML or plain text format by calling Subscription#to[Html/String]Format(Receiver, Context), passing the result to the current delivery option, and calling DeliveryOption#messageFrom[Html/String](MessageContext, String result).
          3. Take the formatted message and deliver it by calling DeliveryOption#deliverMessage(M).
          4. Capture the receiver ID, subscription ID, and any errors thrown as a DeliveryException during delivery of the message, and place into a DeliveryReference receipt for that message.
  6. Compile all delivery references for each receiver, subscription, and delivery option, along with the event message context and original publisher, into a notification object, and save it to the database.
Previous Topic
Notifications
Next Topic
Custom delivery options
Was this topic helpful?
Thanks for your feedback.
The elements that get you up and running in a matter of days, from pre-built content types, to modules, to landing pages.

Content types
Modules
Landing pages
Everything you need to manage and administer content within Brightspot CMS, including plug-and-play integrations.

Dashboards
Authoring content
Workflows
Admin configurations
A guide for installing, supporting and administering code on the Brightspot platform, including integrations requiring developer support to use.

Field types
Content modeling
Rich-text elements
Images