Support » Plugin: WooCommerce » Adding customer name to woocommerce order notification email

  • I’ve been researching this for awhile Is there an extensive list of woocommerce order replacement codes we can use in the email templates to pull in customer name.

    From the templates I’ve been able to figure out that %o pulls in the order id and %s pulls in the blog name. Is there one for first name and last name etc, this would really be good to personalise the emails sent to customers a bit more.

    https://wordpress.org/plugins/woocommerce/

Viewing 4 replies - 1 through 4 (of 4 total)
  • jusgriff, did you find a solution to this?

    Cylis Vaidya

    (@cylisvaidya)

    I was searching for a solution but didn’t find any online. But eventually found a workable solution in one of the email templates that already has the customer name.

    It is in New Order email for admin (admin-new-order.php). It has a nice snippet which says “You have received an order from %s”

    So, just copy that line of code to whichever email template you want to use it and of course change the text to something else

    <p><?php printf( __( 'You have received an order from %s. Their order is as follows:', 'woocommerce' ), $order->billing_first_name . ' ' . $order->billing_last_name ); ?></p>

    Make sure you copy the email template from
    /wp-content/plugins/woocommerce/templates/emails
    to
    /wp-content/themes/YOUR-THEME/woocommerce/templates/emails
    before you edit so that new Woocommerce version won’t overwrite your changes.

    Thanks Cylis Vaidya!

    Thanks, Cylis Vaidya, I will try out this code soon to see how it works!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Adding customer name to woocommerce order notification email’ is closed to new replies.