<?php

if (!defined('ABSPATH')) {
    exit;
}
do_action('woocommerce_email_header', $email_heading, $email);
?>

<?php 
?>
<p><?php 
printf(esc_html__('Hi %s,', 'woocommerce'), esc_html($order->get_billing_first_name()));
?></p>

<?php 
if ($order->needs_payment()) {
    ?>
	<p>
	<?php 
    printf(wp_kses(__('An order has been created for you on %1$s. Your invoice is below, with a link to make payment when you’re ready: %2$s', 'woocommerce'), array('a' => array('href' => array()))), esc_html(get_bloginfo('name', 'display')), '<a href="' . esc_url($order->get_checkout_payment_url()) . '">' . esc_html__('Pay for this order', 'woocommerce') . '</a>');
    ?>
	</p>

<?php 
} else {
    ?>
	<p>
	<?php 
    printf(esc_html__('Here are the details of your order placed on %s:', 'woocommerce'), esc_html(wc_format_datetime($order->get_date_created())));
    ?>
	</p>
	<?php 
}
do_action('woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email);
do_action('woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email);
do_action('woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email);
if ($additional_content) {
    echo wp_kses_post(wpautop(wptexturize($additional_content)));
}
do_action('woocommerce_email_footer', $email);