Disable Automatic Booking Completed Notifications

Prevent “Booking Completed” notifications from being sent automatically when a booking ends. The notification will still be sent when a booking is manually marked as completed.

Instructions

See “Where do I put snippets?” in our documentation for installation instructions.

Code

Filename: gpb-disable-automatic-completed-notification.php

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
/**
 * Gravity Perks // Bookings // Disable Automatic Booking Completed Notifications
 * https://gravitywiz.com/documentation/gravity-forms-bookings/
 *
 * Prevent "Booking Completed" notifications from being sent automatically when a booking
 * ends. The notification will still be sent when a booking is manually marked as completed.
 */
add_action( 'wp_loaded', function() {
	remove_action(
		'gpb_check_completed_bookings',
		array(
			\GP_Bookings\Notifications\Notifications::class,
			'check_and_send_completion_notifications',
		),
		10
	);
}, PHP_INT_MAX );

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.