Terry Tsang

Terry Tsang
About
Add My Account to WooCommerce New Order Email

Add “My Account” Link to WooCommerce New Order Email

If you want to let your new customers know about their My Account login, below is the snippet that can be added and it will display the content and link to the default WooCommerce “My Account” page.

Below is the code you may copy and paste at the bottom of functions.php where you can access it through > Theme File Editor > functions.php.


function tt_add_my_account_to_new_order_email( $order, $is_admin_email, $plain_text, $email ) {
  if ( $email->id == 'customer_completed_order' ) {
    echo 'You can view your all orders by logging into your account here: My Account';
  }
} 

add_action( 'woocommerce_email_after_order_table', 'tt_add_my_account_to_new_order_email', 15, 2 );

Note: Do replace the above URL “https://yourwebsitedomain.com” with your own website domain.

Leave a Comment