Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

rapportdesign on "New User Notification Email Include Name"

$
0
0

I've modified the New User Notification Email to include address details entered during the shopping cart of WooCommerce, but I also need to include the first and last name.

The following code will print the last name matching the hard coded ID...

$user_last = get_user_meta( 5952, 'last_name', true );
$message .= sprintf(__('Last Name: %s'), $user_last) . "\r\n\r\n";

Why does the following not print the last name matching the new users ID?

$user_last = get_user_meta( $user_id, 'last_name', true );
$message .= sprintf(__('Last Name: %s'), $user_last) . "\r\n\r\n";

The following prints the correct ID that I'm trying to target, so this makes little sense to me...

$message .= sprintf(__('User ID: %s'), $user_id) . "\r\n\r\n";

If anyone has any suggestions, I'd be very grateful.


Viewing all articles
Browse latest Browse all 8245

Trending Articles