Content class: Open Notifications

Primary responsibility

Opens the in-app notification center showing the user’s history of received notifications. Source-of-truth is wp_mam_notification_history (renamed from wp_tsl_local_app_notifications_history in PR #31, with backward-compat aliases). Read through MAM_Notification_History_Repository.


Settings

Setting Type Environment Purpose
show_unread_badge yes-no global Render the badge count on the button
mark_read_on_open yes-no global Mark all visible notifications as read when the user opens the screen
empty_state_text textarea global Message when the user has no notifications
style_* various per-button Colors, icon

JSON shape

{
  "notifications": [
    { "id": "1", "title": "...", "body": "...", "read": false, "ts": "..." },
    ...
  ],
  "unread_count": 3
}

The badge count comes from unread_count.


Hooks involved

Hook Type Role
mam_get_phone_data_before_send Filter Notification rows are injected here by mam_notification_manager::manage_phone_data

Gotchas

  • In-app history is separate from push delivery. A push notification that was sent may not show in the in-app history if the notification type was configured for push-only with 'in_app' disabled.
  • clean_notifications() runs in phase_finalize and trims the payload to active items — old / deleted notifications are excluded automatically.
  • Mark-read-on-open is a write (it updates wp_mam_notification_history); high-frequency open events have measurable DB load.

  • Content classes overview
  • Notifications overview
  • Notification queue and cron

Metadata

Field Value
Article type Screen Reference
Plugin slug mam-main
Applies to plugin version 2.1.11+
Category App Settings Reference
Audience WordPress admin / PHP developer
Class name local_app_open_notifications_button (frozen)
Source file includes/content-classes/local-app-open-notifications-content-class.php
Last verified 2026-05-02
Contents

    Need Support?

    Can’t find the answer you’re looking for? Don’t worry we’re here to help!