You can customize the templates by overriding them. Here is the structure you would need to add to your theme.
https://docs.woocommerce.com/document/template-structure/
Edit the admin-new-order.php
Plugin Support
Job a11n
(@jobthomas)
Automattic Happiness Engineer
Hi @massidrink1976 – you can do this by following the same approach as Con suggested in this thread here: https://wordpress.org/support/topic/how-to-add-user-first-name-and-user-name-to-email-body/
This function reference has the way you can pull a username from a WordPress site: https://codex.wordpress.org/Function_Reference/get_userdata
<?php $user_info = get_userdata(1);
echo 'Username: ' . $user_info->user_login . "\n";
echo 'User roles: ' . implode(', ', $user_info->roles) . "\n";
echo 'User ID: ' . $user_info->ID . "\n";
?>
A combo of the two tutorials should do the trick for you.
Plugin Support
Job a11n
(@jobthomas)
Automattic Happiness Engineer
We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.
Hello I’m sorry,
I didn’t work over the weekend…luckily 🙂
I added this code in “admin-new-order”:
do_action( ‘woocommerce_email_header’, $email_heading, $email ); ?>
<?php /* translators: %s: Customer billing full name */ ?>
<?php $user_info = get_userdata(1);
echo ‘Kundennummer: ‘ . $user_info->ID . “\n”;
?>
but something is wrong.
In the confirmation email, “1” appears instead of my username “132064”
I tried also another version:
do_action( ‘woocommerce_email_header’, $email_heading, $email ); ?>
<?php /* translators: %s: Customer billing full name */ ?>
<?php $user_info = get_userdata(1);
echo ‘Username: ‘ . $user_info->user_login . “\n”;
?>
but in this case, appear “admin”.
Regards,
Massimiliano