WP Travel / WP Travel Pro plugin provides various email templates that will be received during booking only and booking with payments.

In the earlier update, the function was added, so that when the admin changes the booking status email will be sent to the customer.

Now, with the release of WP Travel v8.2.0, the function has been added, so the admin can customize the booking status email as per the requirements using the filter code.

Default booking status changed mail received by the customer

So, to change the email content, please add the following code to the functions.php file of your child theme.

Steps to Change Email Content when Booking Status is Changed

1.Add code to functions.php

function wptravel_change_booking_status_email_content( $message, $traveller_name, $old_status, $new_status ) {
    return "<h2>Dear {$traveller_name},</h2>
	    <p>This email is the customized email. Your booking status has been updated from <b>" . $old_status . "</b> to <b>" . $new_status ."</b>.</p><br>
	<h3>Thank you.</h3>";}
add_filter( 'wptravel_email_content_for_booking_status', 'wptravel_change_booking_status_email_content', 10, 4 );

For detailed information on creating a child theme, please refer to our KnowledgeBase.

2. Mail received by the customer after adding customized content

Additionally, if you want to change the subject of the email template, you can do so using a hook.

Hook to change the Subject of booking status Email

add_filter( 'wptravel_email_subject_for_payment_status', function(){
	return __( 'Customized Subject for Payment status', 'wp-travel' );
} );

Also, if you want to learn more about the filter hook that is used to rename fields on the checkout page, please refer to the specific hook page.


So, in this way, you can change email content when payment status is changed precisely.

If you liked this article, then subscribing to our YouTube Channel for WordPress video tutorials would be the cherry on top.

You can also find us on FacebookInstagram, Twitter,LinkedinTikTokPinterest and our dedicated engaging Facebook user community,

Further, if you have any queries, please submit them to our contact page.

Get WP Travel Pro and start creating your travel and tour booking website within minutes without any hassle of coding.

create your travel site within minutes by wptravel.io ,buy wptravel pro