Created
October 22, 2012 09:50
-
-
Save mikejolley/3930685 to your computer and use it in GitHub Desktop.
WooCommerce - Send an email from the customer on order complete.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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