Adding hyperlink inside $message = esc_html__

Hi guys,

I am new to PHP coding. The challenge I am having is that I am trying to add a hyperlink on an already existing code.
The code is:
$message = esc_html__(‘We have received your reservation for’,‘mikado-tours’) . ’ '. $tour_title . ’ '. esc_html__(‘Your booking will be complete upon payment.’, ‘mikado-tours’);

I would want to add or edit it to have: (Follow/Click on this link to process payment)
$message = esc_html__(‘We have received your reservation for’,‘mikado-tours’) . ’ '. $tour_title . ’ '. esc_html__(‘Your booking will be complete upon payment.’ “Click Here to Pay”, ‘mikado-tours’);

Looking forward to your help.
Kind Regards,
Zo

Welcome Aboard!

With that said you are going to have to show more code, format the code to make it easier to display to everyone and esc_html_ doesn’t make sense.

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

Sponsor our Newsletter | Privacy Policy | Terms of Service