show wp-usermeta value in email
-
Hi!!
I′ve tried to send a mail with info of my new user, when user is registered; all works ok, but the registration form is customized, so there are some information in wp-usermeta table. I′ve tried this but it doesn′t work, the word appear empty in the mail.
Do you know what the problem is? Thank you!!function so174837_registration_email_alert( $user_id ) {
$user = get_userdata( $user_id );
$email = $user->user_email;
$userlogin =$user->user_login;//MY ACCESS USERMETA ATTEMPT
$usermeta = get_user_meta($user_id);
$namekid = $usermeta[‘name_kid’];$message = ‘NUEVO USUARIO:’.$email . ‘ has registered to your website. The name is ‘ .$userlogin. ‘ and the kid name is ‘ .$namekid;
wp_mail( ‘[valid email address redacted]’, ‘New User registration’, $message );
}
add_action(‘user_register’, ‘so174837_registration_email_alert’);
- The topic ‘show wp-usermeta value in email’ is closed to new replies.