Skip to content

Instantly share code, notes, and snippets.

@grola
Last active February 28, 2018 20:38
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Add customer note to all admin emails
<?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