Confetti Bits

CB_Notifications_Component extends BP_Core_Notification_Abstract
in package

Formats Confetti Bits Notifications.

We use this in tandem with BuddyBoss Platform to give us email, web, and push notifications. An absolute godsend, this makes it a million times easier to do that stuff, so we can focus on the actual functionality.

Tags
since
2.0.0

Table of Contents

Properties

$instance  : mixed
Set up singleton instance.

Methods

__construct()  : mixed
Constructor function.
format_notification()  : mixed
instance()  : mixed
Return the instance kiddos.
load()  : mixed
Registers notification formats.
register_anniversary_notifications()  : mixed
register_birthday_notifications()  : mixed
register_cb_activity_notifications()  : mixed
Registers notifications for activity posts.
register_cb_events_notifications()  : mixed
Registers all our notifications for the transactions component.
register_cb_requests_notifications()  : mixed
Registers notifications for the requests component.
register_cb_spot_bonus_notifications()  : mixed
Registers all our notifications for the transactions component.
register_cb_transactions_notifications()  : mixed
Registers all our notifications for the transactions component.
register_cb_volunteers_notifications()  : mixed
Registers all our notifications for the transactions component.
register_group_activity_notifications()  : mixed
register_participation_notifications()  : mixed

Properties

Methods

__construct()

Constructor function.

public __construct() : mixed

Start your engines. We're gonna be so notified.

Tags
see
CB_Notifications_Component::start()

format_notification()

public format_notification(mixed $content, mixed $item_id, mixed $secondary_item_id, mixed $total_items, mixed $component_action_name, mixed $component_name, mixed $notification_id, mixed $screen) : mixed
Parameters
$content : mixed
$item_id : mixed
$secondary_item_id : mixed
$total_items : mixed
$component_action_name : mixed
$component_name : mixed
$notification_id : mixed
$screen : mixed

load()

Registers notification formats.

public load() : mixed

What's the difference between this and start(), you may ask? Don't. Don't ask me, at least. Best guess? Start() calls load(), and load() actually registers notifications.

Tags
UPDATE:

I was mostly right. $this::start() calls $this::load(), and also adds a bunch of filter hooks that dynamically update notification configurations based on the what is supplied to the inherited class methods. $this::load() is an abstract method that just calls whatever is inside of it.

Regardless, here we are. It works, doesn't it?

To be a little clearer:

1. The *notification group* is the one true group for all our
	  notifications. Everything we have will be registered under
	  the confetti_bits group (unless I change my mind later
	  lmao).

2. Notification *types* are going to be for our different
	  components. So, cb_transactions, cb_requests,
	  cb_participation, are all going to get their own types.
	  The type created by $this->register_notification_type()
	  is used to add a settings field for a user to control
	  their notification options. This is a little different
	  from how BuddyBoss does things, because their notification
	  *groups* are based on their components, whereas we're
	  putting all our components into the main 'confetti_bits'
	  group. Ipso facto, our notification *types* are going to be
	  component-based. It'll make sense eventually. Maybe.

3. The notifications created by $this->register_notification()
	  are going to distinguish which notification
	  should be sent, based on a user's action. So this would
	  be where the component_action comes in, like
	  cb_send_bits, cb_anniversary_bits, cb_import_bits, etc.
	  The notifications are sent out in a function that's
	  typically defined in a cb-{$component}-notifications.php
	  file. If that file doesn't exist... why does it not?
	  Make one. That file needs to exist.

4. Notification content is formatted in
	  $this->format_notification(). The tokens are usually
	  added in the same function talked about in part 3.

register_cb_events_notifications()

Registers all our notifications for the transactions component.

public register_cb_events_notifications() : mixed

register_cb_requests_notifications()

Registers notifications for the requests component.

public register_cb_requests_notifications() : mixed

register_cb_spot_bonus_notifications()

Registers all our notifications for the transactions component.

public register_cb_spot_bonus_notifications() : mixed

register_cb_transactions_notifications()

Registers all our notifications for the transactions component.

public register_cb_transactions_notifications() : mixed

register_cb_volunteers_notifications()

Registers all our notifications for the transactions component.

public register_cb_volunteers_notifications() : mixed

        
On this page

Search results