/** * Function to send invoice as email */ function woocommerce_pip_send_email($order_id) { if (get_option('woocommerce_pip_send_email') == 'enabled') { // Build email information $order = new WC_Order($order_id); $to = $order->billing_email; $subject = __('Order invoice', 'woocommerce-pip'); $subject = '[' . get_bloginfo('name') . '] ' . $subject; $attachments = ''; // Read the file ob_start(); require_once woocommerce_pip_template('dir', 'email-template.php') . 'email-template.php'; $message = ob_get_clean(); // Send the mail woocommerce_mail($to, $subject, $message, $headers = "Content-Type: text/html\r\n", $attachments); } }
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title><?php _e('Print order details', 'woocommerce-pip'); ?> </title> <link href="<?php echo woocommerce_pip_template('uri', 'template.php'); ?> css/woocommerce-pip-print.css" rel=" stylesheet" type="text/css" media="print" /> <link href="<?php echo woocommerce_pip_template('uri', 'template.php'); ?> css/woocommerce-pip.css" rel=" stylesheet" type="text/css" media="screen,print" /> </head> <body <?php if ($client != true) { echo woocommerce_pip_preview(); } ?> >