LLMS_Abstract_Notification_Controller::send( bool $force = false, null|string[] $filter_types = null )

Send all the subscriptions


Parameters Parameters

$force

(bool) (Optional) If true, will force a send even if duplicates. Default is false. Only applies to controllers that flag $this->auto_dupcheck to true.

Default value: false

$filter_types

(null|string[]) (Optional) Array of notification types to be sent. Default is null. When not provided (null) all the types.

Default value: null


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/abstracts/llms.abstract.notification.controller.php

	 *                                    When not provided (`null`) all the types.
	 * @return void
	 */
	public function send( $force = false, $filter_types = null ) {

		$this->add_subscriptions( $filter_types );

		foreach ( $this->get_subscriptions() as $subscriber => $types ) {
			foreach ( $types as $type ) {

				$this->send_one( $type, $subscriber, $force );

			}
		}

		/**
		 * Cleanup subscriptions so if the notification
		 * is triggered again we don't have incorrect subscribers
		 * on the next trigger.
		 * This happens when receipts are triggered in bulk by action scheduler.
		 */


Top ↑

Changelog Changelog

Changelog
Version Description
5.2.0 Added parameter to only send notifications of specific types.
3.8.0
3.11.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.