Noptin_New_Post_Notify::schedule_notification( $post,  $automation )

Notifies subscribers of a new post


Source Source

File: includes/class-noptin-new-post-notify.php

	public function schedule_notification( $post, $automation ) {

		$sends_after      = (int) get_post_meta( $automation->ID, 'noptin_sends_after', true );
		$sends_after_unit = get_post_meta( $automation->ID, 'noptin_sends_after_unit', true );

		if ( ! empty( $sends_after ) ) {

			$sends_after_unit = empty( $sends_after_unit ) ? 'minutes' : $sends_after_unit;
			$timestamp        = strtotime( "+ $sends_after $sends_after_unit", current_time( 'timestamp', true ) );
			return schedule_noptin_background_action( $timestamp, 'noptin_new_post_notification', $post->ID, $automation->ID );

		}

		return do_noptin_background_action( 'noptin_new_post_notification', $post->ID, $automation->ID );

	}


Top ↑

User Contributed Notes User Contributed Notes

30 day money back guarantee
Safe & Secure online payment
Custom CSS Slide Example
Custom Animation Example
Default Animation