PhoenixKit.Notifications.Render (phoenix_kit v1.7.102)

Copy Markdown View Source

Human-readable rendering for notifications.

Maps {activity.action, activity.metadata}%{icon, text, link, actor_uuid} so the bell dropdown and inbox page don't need to know the action taxonomy.

Unknown actions fall back to the raw action string with a generic icon, so a new action that hasn't been mapped yet still displays safely.

Summary

Functions

Returns the display payload for a notification.

Types

render_result()

@type render_result() :: %{
  icon: String.t(),
  text: String.t(),
  link: String.t() | nil,
  actor_uuid: String.t() | nil
}

Functions

render(notification)

Returns the display payload for a notification.

notification.activity must be preloaded.