user_id = $student_id; $this->post_id = $section_id; $this->section = llms_get_post( $section_id ); $this->course = $this->section->get_course(); $this->send(); } /** * Takes a subscriber type (student, author, etc) and retrieves a User ID * * @param string $subscriber subscriber type string * @return int|false * @since 3.8.0 * @version 3.8.0 */ protected function get_subscriber( $subscriber ) { switch ( $subscriber ) { case 'course_author': $uid = $this->course->get( 'author' ); break; case 'student': $uid = $this->user_id; break; default: $uid = false; } return $uid; } /** * Get the translatable title for the notification * used on settings screens * * @return string * @since 3.8.0 * @version 3.8.0 */ public function get_title() { return __( 'Section Complete', 'lifterlms' ); } /** * Setup the subscriber options for the notification * * @param string $type notification type id * @return array * @since 3.8.0 * @version 3.8.0 */ protected function set_subscriber_options( $type ) { $options = array(); switch ( $type ) { case 'basic': $options[] = $this->get_subscriber_option_array( 'student', 'yes' ); break; case 'email': $options[] = $this->get_subscriber_option_array( 'course_author', 'no' ); $options[] = $this->get_subscriber_option_array( 'custom', 'no' ); break; } return $options; } } return LLMS_Notification_Controller_Section_Complete::instance();