Admin New-Order Email Subject Personalization WordPress Function
What it does?
-
Checks the email is for a valid order.
-
Retrieves and sanitizes the billing first/last name.
-
Replaces
{order_firstname}and{order_lastname}in the subject line and returns the result.
Why it’s useful?
-
Faster triage: See who ordered at a glance.
-
Cleaner inbox: More informative subjects improve threading and search.
-
Zero hassle: Works with your existing subject—just add the placeholders in WooCommerce → Emails → New order subject, e.g.
New order from {order_firstname} {order_lastname} – #{order_number}.
