LLMS_Student::get_notification_subscription( string $type, string $trigger, string $default = 'no' )

Retrieve a user’s notification subscription preferences for a given type & trigger


Parameters Parameters

$type

(string) (Required) notification type: email, basic, etc...

$trigger

(string) (Required) notification trigger: eg purchase_receipt, lesson_complete, etc...

$default

(string) (Optional) value to return if no setting is saved in the db

Default value: 'no'


Top ↑

Return Return

(string) yes or no


Top ↑

Source Source

File: includes/models/model.llms.student.php

	public function get_notification_subscription( $type, $trigger, $default = 'no' ) {

		$prefs = $this->get( 'notification_subscriptions' );
		if ( ! $prefs ) {
			$prefs = array();
		}

		if ( isset( $prefs[ $type ] ) && isset( $prefs[ $type ][ $trigger ] ) ) {
			return $prefs[ $type ][ $trigger ];
		}

		return $default;

	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.10.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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