eventsmanager icon

Send email per booking status

eventsmanager | PRO | 02/08/24 04:35:04 AM UTC | 0 ⭐ | 553 👁️ | Never ⏰ | []
text |

810 B

|

None

|

0 👍

/

0 👎

<?php
 /*
 * How to use this snippet
 *   - using your host cpanel or ftp, go to wp-content > (create this folder) mu-plugins > (create this php file) functions.php
 *   - edit file functions.php
 *   - paste the snippet below
 *  
 * Booking Status:
 * 0 = Pending
 * 1 = Approved
 * 2 = Rejected
 * 3 = Cancelled
 * 4 = Awaiting Online Payment
 * 5 = Awaiting Payment
 */
 function my_em_custom_email($result, $EM_Booking){
	if ( $EM_Booking->booking_status == 1 ){
 		foreach($emails as $key => $value) {
			$EM_Booking->email_send(
			 $EM_Booking->output(get_option('dbem_bookings_email_confirmed_subject')),
			 $EM_Booking->output(get_option('dbem_bookings_email_confirmed_body')),
			 $value
			);
		}
 	}
	return $result;
}
add_filter('em_booking_set_status','my_em_custom_email',100,2);

Comments