I manage a website, we want to integrate two forms in a row, but we want to receive only one notification.
If the person doesn’t finish both forms within 10 minutes, the first form should send us a notification with the information from the first form, however if the person completes the second form we should only receive the notification from the second form. We don’t want both notifications if the person goes to the end.
We use Gravity Forms Delayed Notifications to delay sending the notifications. I don’t see how we can use the conditional logic and the Delayed notifications tool to receive only one notification?
Gravity Flow has a couple of hooks and conditional logic support that could definitely address the requirement if that delayed option one does not.
Steps can be scheduled for when they should start, and then gravityflow_step_is_condition_met would allow you to look up whether the other form has had an entry submitted or not to determine whether the notification should/not be sent.
Or you could use the Form Connector extensions’ Update an Entry step. So that when Form 2 is submitted it updates a radio button in Form 1s’ entry to indicate that Form 2 has been submitted. In that way, the standard conditional logic to execute the step depending on the value of the radio button would work.
Setup a notification on Form A with a 10 minute delay using Notification Scheduler’s “Schedule” setting on the desired notification.
Pass the entry ID from Form A to Form B and capture it in a Hidden field via dynamic population.
Use this code to delete the scheduled notification from Form A for the passed entry when Form B is submitted.
// Update "123" to the ID for Form B.
add_action( 'gform_after_submission_123', function( $entry ) {
// Update to the notification ID; you can find this in the URL on the notification edit view.
$notification_id = 'abc123def';
// Update to the Hidden field ID on Form B that was populated with the entry ID from Form A.
$entry_id_field_id = 4;
if ( is_callable( 'gp_notification_schedule' ) ) {
gp_notification_schedule()->delete_notification_queue_by_notification_id( $notification_id, $entry[ $entry_id_field_id ] );
}
} );
This sounds like the same concept you are trying to implement with your Delayed Notifications plugin but I’m not familiar enough with that to write a code snippet.