Home » WooCommerce: Add First Name to Order Email Subject

WooCommerce: Add First Name to Order Email Subject

by Tutor Aspire

Today we take a look at the WooCommerce Emails and specifically at how to change the subject of the Customer Processing Order email by adding the billing “First Name”. As usual, this is a matter of 3 lines of PHP code – feel free to copy/paste and customize it to your liking 🙂

WooCommerce: change subject of the customer processing order email
WooCommerce: change subject of the customer processing order email

PHP Snippet: Add Billing First Name to Order Email Subject

/**
 * @snippet       Add Billing First_name to Email Receipt (Customer Processing)
 * @how-to        Get tutoraspire.com FREE
 * @author        Tutor Aspire
 * @testedwith    WooCommerce 3.8
 * @donate $9     https://www.tutoraspire.com
 */
 
add_filter( 'woocommerce_email_subject_customer_processing_order', 'tutoraspire_change_processing_email_subject', 10, 2 );
 
function tutoraspire_change_processing_email_subject( $subject, $order ) {
   $subject = $order->get_billing_first_name() . ', thanks for your order!';
   return $subject;
}

You may also like