Real-time Notifications Setup

Overview

This document provides instructions for the extension " Real-time Notifications". This extension allows users to receive updates and notifications directly on the website as they happen.

Contents

Settings #

Extension's settings #

The extension adds the tab "Notifications" under the page [Ultimate Member > Settings > Extensions] when activated. Once you navigate to the Notifications tab, you will see the options below:

  • Enable real-time instant notification - It is recommended to turn this setting off if your server is getting some load.
  • How often do you want the ajax notifier to check for new notifications? (in seconds) - Set a period of the notifications update. We don't recommend setting a very short period to avoid site overload.
  • Where should the notification icon appear? - Select a place where the notification icon should be displayed.
  • Always display the notification icon - If turned off, the icon will only show when there's a new notification.
  • Notification sound - Play a sound when a new notification appears. It may not work in Chrome due to Autoplay Policy.
  • Account Tab
  • Turn on or off notifications and edit the templates for the following:
    • Role upgrade
    • New comment reply
    • New user comment
    • New guest comment
    • User view profile
    • Guest view profile
    • User awarded points for action
    • User deducted points for action
    • User receives points from another person
    • New user review
    • User get a new private message
    • User get followed by a person
    • User get a new friend request
    • User get a new friend
    • User get a new wall post
    • User get a new wall comment
    • User get a new post like
    • User get a new mention
    • User account is verified
    • Groups - Approve Member
    • Groups - Join Request
    • Groups - Invite Member
    • Groups - Change Group Role
    • Groups - New post
    • Groups - New comment
    • Your job is approved
    • Your job is expired
    • User mention you in forum
    • User leaves a reply to topic
    • User creates a topic in forum

Pages settings #

Once you install the extension, it creates the page "Notifications". This page contains a shortcode [ultimatemember_notifications] that shows a list of notifications for the current user.

You can make this page manually if it is lost. Once the page is created, you should configure it using the setting "Notifications page" on the [Ultimate Member > Settings > General > Pages]

User features #

Notification button #

A red circle will appear on the notifications button with a number inside when a user receives a notification. This number indicates how many new notifications are received. Users can view new and past notifications via the notifications button/popup or by going to the notifications page.

Note: The theme "UM Theme" may move the button to the site's header.

Picture - The notifications button

Picture - The notifications button in the theme "UM Theme"

The red dot with the counter is visible only when there are new notifications.

Picture - The notifications popup

The extension provides options to view all and unread notifications.User can also load more notifications in the notification popup. When the ellipsis "..." icon is clicked, users can choose what action to make, they can choose to See all notifications, Mark all notifications as read, Clear all the notifications and they can go to the Notifications settings.


Each notification has an ellipsis "...". The button lets the user mark the notification as read, remove the notification or disable the type of notification. The notification will be marked as read-only after the "mark as read" action is clicked or after visiting the notification URL.

Switch notifications ON/OFF #

If the setting " Account Tab" is turned on under the Notifications settings, users can control what notifications they want to receive from the tab "Web Notifications" in their account page. These include core notifications as well as installed extension notifications (E.g. User Reviews and myCrRED).

Picture - wp-admin>Ultimate Member> Settings>Extension>Notifications

Picture - The tab "Web Notifications"

For developers #

The code samples #

Add your custom notification

Look for an example here: Using notifications API to add custom notifications

Disable the default notification feed button in the footer

Add the code snippet below to the end of the file functions.php in the active theme directory.

add_action( 'init', function() {
	remove_action( 'wp_footer', 'um_notification_show_feed', 99999999999 );
} );