Last active
February 28, 2018 20:38
-
-
Save grola/c64579861724cf85ca470ec6e3d90d02 to your computer and use it in GitHub Desktop.
Add customer note to all admin emails
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
<?php | |
add_action( 'woocommerce_email_after_order_table', 'studiowp_woocommerce_email_after_order_table_customer_note', 10, 4 ); | |
function studiowp_woocommerce_email_after_order_table_customer_note( $order, $sent_to_admin, $plain_text, $email ) { | |
if ( $sent_to_admin ) { | |
if ( $order->get_customer_note() != '' ) { | |
echo sprintf( '<h2>%s</h2>', __( 'Customer note', 'woocommerce' ) ); | |
echo sprintf( '<p><strong>%s</strong></p>', $order->get_customer_note() ); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment