WordPress.org

Forums

WooCommerce - excelling eCommerce
Adding customer name to woocommerce order notification email (5 posts)

  1. jusgriff
    Member
    Posted 1 year ago #

    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/

  2. Strategic1dentity
    Member
    Posted 10 months ago #

    jusgriff, did you find a solution to this?

  3. Cylis Vaidya
    Member
    Posted 7 months ago #

    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.

  4. uogecko
    Member
    Posted 4 months ago #

    Thanks Cylis Vaidya!

  5. jusgriff
    Member
    Posted 4 months ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic