Skip to content

Instantly share code, notes, and snippets.

@mikejolley
Created October 22, 2012 09:50
Show Gist options
  • Save mikejolley/3930685 to your computer and use it in GitHub Desktop.
Save mikejolley/3930685 to your computer and use it in GitHub Desktop.
WooCommerce - Send an email from the customer on order complete.
add_action( 'woocommerce_order_status_completed', 'custom_send_email_from_customer' );
function custom_send_email_from_customer( $order_id ) {
$order = new WC_Order( $order_id );
$headers = 'From: ' . $order->billing_first_name . ' ' . $order->billing_last_name . ' <' . $order->billing_email . '>' . "\r\n";
wp_mail( 'someone@somesite.com', 'Subject', 'Message', $headers );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment