Last active
March 8, 2022 20:00
-
-
Save claygriffiths/48d8f31176f65cf48b1379a76813d504 to your computer and use it in GitHub Desktop.
Revisions
-
claygriffiths revised this gist
Mar 8, 2022 . 1 changed file with 6 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,17 +11,17 @@ $form_id = 6; $notification_id = '61f43ccb47dfd'; // See https://www.php.net/manual/en/datetime.formats.php for supported date/time formats. $desired_time = '+6 months 12:00 PM'; if ( (int) $entry['form_id'] !== (int) $form_id || $notification['id'] !== $notification_id ) { return $timestamp; } /* Only change the timestamp if scheduling the recurring notification. */ if ( ! $is_recurring ) { return $timestamp; } $local_timestamp = date( 'Y-m-d H:i:s', strtotime( $desired_time ) ); $utc_timestamp = strtotime( get_gmt_from_date( $local_timestamp ) ); -
claygriffiths revised this gist
Mar 8, 2022 . No changes.There are no files selected for viewing
-
claygriffiths created this gist
Mar 8, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ <?php /** * Gravity Perks // GP Notification Scheduler // Set Recurring Schedule to Every 6 Months * https://gravitywiz.com/documentation/gravity-forms-notification-scheduler * * Instructions: * * Install snippet per https://gravitywiz.com/documentation/how-do-i-install-a-snippet/ * * Update $form_id, $notification_id, and if required, $desired_time */ add_filter( 'gpns_schedule_timestamp', function ( $timestamp, $notification, $entry, $is_recurring, $current_time ) { $form_id = 6; $notification_id = '61f43ccb47dfd'; // See https://www.php.net/manual/en/datetime.formats.php for supported date/time formats. $desired_time = '+6 months 12:00 PM'; if ( (int) $entry['form_id'] !== (int) $form_id || $notification['id'] !== $notification_id ) { return $timestamp; } /* Only change the timestamp if scheduling the recurring notification. */ if ( ! $is_recurring ) { return $timestamp; } $local_timestamp = date( 'Y-m-d H:i:s', strtotime( $desired_time ) ); $utc_timestamp = strtotime( get_gmt_from_date( $local_timestamp ) ); return $utc_timestamp; }, 10, 5 );