Thank you for your reply.
Below is the function that sends the client the email.
/**
* @param $bookingEmail
*/
private function sendUserConfirmationEmail($id, $bookingEmail, $bookingHash) {
//Get email address
$mail_to = $bookingEmail;
$tour_id = $id;
$tour_title = get_the_title($tour_id);
$name = get_bloginfo('name');
$email = get_bloginfo('admin_email');
$booking = $this->getBookingByHash($bookingHash);
$booking_time_html = '';
if(!empty($booking->booking_time)) {
$booking_time_html = $booking->booking_time . 'h';
}
$message = esc_html__('We have received your reservation for','mikado-tours') . ' '. $tour_title . ' '. esc_html__('Your booking will be complete upon payment.', 'mikado-tours');
$subject = esc_html__('Booking Information For', 'mikado-tours') . ' '. $tour_title . ' '. esc_html__('on', 'mikado-tours') . ' ' . $name;
$headers = array(
'From: ' . $name . ' <' . $email . '>',
'Reply-To: ' . $name . ' <' . $email . '>',
);
$messageTemplate = esc_html__('From', 'mikado-tours'). ': ' . $name . "\r\n";
$messageTemplate .= esc_html__('Message', 'mikado-tours') . ': ' . $message . "\r\n\n";
$messageTemplate .= esc_html__('Number of Tickets', 'mikado-tours') . ': ' . $booking->amount . "\r\n\n";
$messageTemplate .= esc_html__('Price', 'mikado-tours') . ': ' . $booking->price . "\r\n\n";
$messageTemplate .= esc_html__('Departure Date', 'mikado-tours') . ': ' . date(get_option('date_format'), strtotime($booking->booking_date)) . ' ' . $booking_time_html . "\r\n\n";
wp_mail(
$mail_to, //Mail To
$subject, //Subject
$messageTemplate, //Message
$headers //Additional Headers
);
}
Looking forward to your help.
Kind Regards,
Zo