public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/classes/dripfeed.php
/**
		 * Process a defined number of items from the queue, and send the right emails to those users.
		 *
		 * @param Integer $count The number of items to send out to users.
		 */
Process a defined number of items from the queue, and send the right emails to those users.
@param Integer $count The number of items to send out to users.
Process a defined number of items from the queue and send the right emails to those users . @param Integer $count The number of items to send out to users .
public static function processQueueItems( $count ) {
			global $wpdb, $wpcwdb;
			$wpdb->show_errors();
			$queueItems = $wpdb->get_results( $wpdb->prepare(
				"SELECT *
				 FROM $wpcwdb->queue_dripfeed
				 WHERE queue_trigger_date <= %s
				 LIMIT %d",
				current_time( 'mysql' ),
				$count
			) );
			$queueItems = apply_filters( 'wpcw_dripfed_queue_items', $queueItems );
			if ( ! empty( $queueItems ) ) {
				foreach ( $queueItems as $singleTrigger ) {
					$parentData  = WPCW_units_getAssociatedParentData( $singleTrigger->queue_unit_id );
					$userDetails = get_userdata( $singleTrigger->queue_user_id );
					$subject = apply_filters( 'wpcw_dripfeed_queue_item_email_subject', $parentData->email_unit_unlocked_subject, $singleTrigger, $parentData, $userDetails );
					$body = apply_filters( 'wpcw_dripfeed_queue_item_email_body', $parentData->email_unit_unlocked_body, $singleTrigger, $parentData, $userDetails );
					do_action( 'wpcw_dripfeed_queue_item', $singleTrigger, $parentData, $userDetails );
					WPCW_email_sendEmail( $parentData, $userDetails, $userDetails->user_email, $subject, $body );
					$wpdb->query( $wpdb->prepare( "DELETE FROM $wpcwdb->queue_dripfeed WHERE queue_id = %d", $singleTrigger->queue_id ) );
				}
			}
			die();
		}
public static function processQueueItems ( $ count ) { global $ wpdb , $ wpcwdb ; $ wpdb -> show_errors ( ) ; $ queueItems = $ wpdb -> get_results ( $ wpdb -> prepare ( " SELECT *
				 FROM  $ wpcwdb -> queue_dripfeed 
				 WHERE queue_trigger_date <= %s
				 LIMIT %d " , current_time ( 'mysql' ) , $ count ) ) ; $ queueItems = apply_filters ( 'wpcw_dripfed_queue_items' , $ queueItems ) ; if ( ! empty ( $ queueItems ) ) { foreach ( $ queueItems as $ singleTrigger ) { $ parentData = WPCW_units_getAssociatedParentData ( $ singleTrigger -> queue_unit_id ) ; $ userDetails = get_userdata ( $ singleTrigger -> queue_user_id ) ; $ subject = apply_filters ( 'wpcw_dripfeed_queue_item_email_subject' , $ parentData -> email_unit_unlocked_subject , $ singleTrigger , $ parentData , $ userDetails ) ; $ body = apply_filters ( 'wpcw_dripfeed_queue_item_email_body' , $ parentData -> email_unit_unlocked_body , $ singleTrigger , $ parentData , $ userDetails ) ; do_action ( 'wpcw_dripfeed_queue_item' , $ singleTrigger , $ parentData , $ userDetails ) ; WPCW_email_sendEmail ( $ parentData , $ userDetails , $ userDetails -> user_email , $ subject , $ body ) ; $ wpdb -> query ( $ wpdb -> prepare ( " DELETE FROM  $ wpcwdb -> queue_dripfeed  WHERE queue_id = %d " , $ singleTrigger -> queue_id ) ) ; } } die ( ) ; }
Process a defined number of items from the queue, and send the right emails to those users.
Process a defined number of items from the queue and send the right emails to those users .
// See if we have any items that have expired. /**
			 * Filter: Dripfeed Queue Items
			 *
			 * @since 4.4.0
			 *
			 * @param object $queueItems The dripfeed queue items.
			 *
			 * @return object $queueItems The dripfeed queue items.
			 */ // Send an email to the user for each queue item. // Performance enhancements could be possible by caching the parent data for units that are the same. // Need user and parent data in order to send the email. /**
					 * Filter: Dripfeed Queue Item Email Subject.
					 *
					 * @since 4.4.0
					 *
					 * @param string The unlocked unit subject.
					 * @param object $singleTrigger The single trigger item
					 * @param object $parentData The parent unit data.
					 * @param object $userDetails The user details.
					 *
					 * @return string The unlocked unit subject.
					 */ /**
					 * Filter: Dripfeed Queue Item Email Body.
					 *
					 * @since 4.4.0
					 *
					 * @param string The unlocked unit body.
					 * @param object $singleTrigger The single trigger item
					 * @param object $parentData The parent unit data.
					 * @param object $userDetails The user details.
					 *
					 * @return string The unlocked unit body.
					 */ /**
					 * Action: Dripfeed Queue Item.
					 *
					 * @since 4.4.0
					 *
					 * @param object $singleTrigger The single trigger item
					 * @param object $parentData The parent unit data.
					 * @param object $userDetails The user details.
					 */ // Send the email with the details and a link to the unit. // Delete the queue item so that it doesn't need to execute again.