LLMS_Abstract_Notification_Controller::send_one( string $type, mixed $subscriber, bool $force = false )

Send a notification for a subscriber


Parameters Parameters

$type

(string) (Required) notification type id

$subscriber

(mixed) (Required) WP User ID for the subscriber, email address, phone number, etc...

$force

(bool) (Optional) if true, will force a send even if duplicate's only applies to controllers that flag $this->auto_dupcheck to true

Default value: false


Top ↑

Return Return

(int|false)


Top ↑

Source Source

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

	 *
	 * @param string $type Notification type [email|basic].
	 * @return bool
	 */
	public function is_testable( $type ) {

		if ( empty( $this->testable[ $type ] ) ) {
			return false;
		}

		return true;

	}

	/**
	 * Send all the subscriptions
	 *
	 * @since 3.8.0
	 * @since 3.11.0 Unknown.
	 * @since 5.2.0 Added parameter to only send notifications of specific types.
	 *
	 * @param bool          $force        Optional. If true, will force a send even if duplicates. Default is `false`.
	 *                                    Only applies to controllers that flag $this->auto_dupcheck to true.
	 * @param null|string[] $filter_types Optional. Array of notification types to be sent. Default is `null`.
	 *                                    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


Top ↑

Changelog Changelog

Changelog
Version Description
3.8.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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