Last active
October 20, 2022 11:25
-
-
Save bekarice/50900986dc58f00ec765 to your computer and use it in GitHub Desktop.
Add customer name to WooCommerce Admin New Order Email subject
This file contains hidden or 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 // only copy this line if needed! | |
/** | |
* Adds customer first and last name to admin new order email subject. | |
* | |
* @param string $subject email subject | |
* @param \WC_Order $order the order object for the email | |
* @return string updated subject | |
*/ | |
function skyverge_add_customer_to_email_subject( $subject, $order ) { | |
$subject .= ' from ' . $order->get_billing_first_name() . ' ' . $order->get_billing_last_name(); | |
return $subject; | |
} | |
add_filter( 'woocommerce_email_subject_new_order', 'skyverge_add_customer_to_email_subject', 10, 2 ); |
hello, same question would be important for me. the code works fine, just the product name must be added to the subject.
How can that be done?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if i want product name Was Sold how to do that?