Trigger automations with In app notifications

πŸ” Problem Statement

We need an in-app notification channel for event-based workflows that works across ALL Pelcro UIs β€” Default UI, React Elements, and fully custom UIs built directly on the JS SDK. Building rendering logic per UI layer would leave custom-UI publishers without coverage. The JS SDK is the common denominator across all Pelcro frontends.

πŸ’‘ User Story

As a marketer, I want to send an in-app notification (banner, toast, or inline card) to customers matching an event-based segment, so I can engage users in the moment β€” regardless of which Pelcro UI surface they are on.

As a developer integrating Pelcro, I want a simple way to either auto-render notifications OR listen to an event and render them myself, so I am not forced to migrate UI surfaces just to use this feature.

🎯 Definition of Done (DoD)

────────────────────────────────

ARCHITECTURE β€” JS SDK MODULE

────────────────────────────────

βœ” New Pelcro.notifications module in the JS SDK, following the same conventions as Pelcro.user, Pelcro.subscription, etc.

βœ” On user authentication, the SDK calls GET /notifications/active and fetches the list of pending in-app notifications for that customer.

βœ” For each pending notification, the SDK dispatches a notification.received event consumable by publisher code.

βœ” The SDK exposes a simple API for retrieval, dismissal, and click tracking:

β€’ Pelcro.notifications.list()

β€’ Pelcro.notifications.refresh()

β€’ Pelcro.notifications.dismiss(id)

β€’ Pelcro.notifications.markAsClicked(id)

β€’ Pelcro.notifications.on('received' | 'dismissed' | 'clicked', callback)

────────────────────────────────

TWO INTEGRATION PATHS

────────────────────────────────

Path 1 β€” Default UI/React elements:

βœ” Pelcro.notifications.enable({ position, theme, maxVisible, autoDismissAfter }) opt-in renders notifications automatically with brand-aware styling (site logo + color palette).

  1. Default UI and React Elements use this built-in renderer under the hood β€” zero integration effort for those publishers.

Path 2 β€” Custom UIs

βœ” Custom-UI publishers subscribe to Pelcro.notifications.on('received', callback) and render notifications however they want.

βœ” A ~20-line sample HTML/JS snippet is published in the developer docs showing how to subscribe and render.

────────────────────────────────

Platform UI

────────────────────────────────

Add a simple rich text editor for notification content in the automation form.

Fields:

β€’ Title (required) β€” plain text, single line, no formatting

β€’ Body (required) β€” rich text editor: bold, italic, links, ordered/unordered lists. No images, no embeds, no custom HTML.

β€’ CTA label (optional) β€” plain text, single line

β€’ CTA URL (optional) β€” validated as URL

β€’ Dismissible (toggle, default: true)

β€’ Expiry (default: 30 days, configurable per workflow)

βœ” Notifications are delivered on the customer's next page load after they enter the segment

βœ” Notifications are user-scoped β€” only authenticated customers receive them. Anonymous visitors do not.

βœ” Notifications NOT loaded by the customer within the expiry window are marked expired and not redelivered.

Please authenticate to join the conversation.

Upvoters
Status

In Planning

Board
πŸ’‘

Pelcro Product

Date

3 days ago

Author

Rana Haleem

Subscribe to post

Get notified by email when there are changes.