Support Gravity View Notification Triggers

Use this snippet when using Gravity View Notification Trigger with Gravity Perks Notification Scheduler.

Code

Filename: gpns-gravityview-notifications-on-approve.php

<?php
/**
 * Gravity Wiz // Notification Scheduler // Support Gravity View Notification Triggers
 * https://gravitywiz.com/documentation/gravity-forms-notification-scheduler/
 *
 * Use this snippet when using Gravity View Notification Trigger with Gravity Perks Notification Scheduler.
 */
add_filter( 'gpns_schedule_timestamp', function ( $timestamp, $notification, $entry, $is_recurring, $current_time ) {
	// Only process for GravityView notification events.
	if ( strpos( $notification['event'], 'gravityview' ) === false ) {
		return $timestamp;
	}

	return time() + 5; // Use current time plus a few seconds to force-schedule GravityView event.
}, 10, 5 );

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.