Skip to content

Instantly share code, notes, and snippets.

@w33zy
Created November 13, 2020 03:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save w33zy/11b04a4c6802e721a461e97e867d5c0d to your computer and use it in GitHub Desktop.
Save w33zy/11b04a4c6802e721a461e97e867d5c0d to your computer and use it in GitHub Desktop.
<?php
/**
* Filter the content of the new user registration email
* @param $message The email content
* @param $user The user object
* @param $blogname The name of the site
* @param $url The url for the user profile
*/
function prefix_new_registration_email_content( $message, $user, $blogname, $url ) {
$_message = $meessage . '<br>';
$extra_field = get_user_meta( $user->user_id, 'my_extra_field_name', true );
$_message = sprintf( '<p>%s</p>', $extra_field );
return $_message;
}
add_filter( 'wcmo_new_registration_email_content', 'prefix_new_registration_email_content', 10, 4 );
@elsaveronicagd
Copy link

This is helpful. Any other way to add the $user info to 'print'? I can't make it work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment