0

I want to add some xprofile fields in bp_core_signup_user e-mail that I sent to the site admin if a new Buddypress user has signed up. Any Idea what I'm doing wrong?

/* Sends custom pending notification e-mail to WP admin */

function my_pending( $user_id, $user_login, $user_password, $user_email, $usermeta ) {
$field1 = xprofile_get_field_data( 11, $user_id );
$field2 = xprofile_get_field_data( 12, $user_id );
$field3 = xprofile_get_field_data( 4, $user_id );
wp_mail( "example@example.com", $user_login . "bla bla", "bla bla $field1, $field2, $field3" );
}
add_action( 'bp_core_signup_user', 'my_pending', 10, 5 );
Gerard
  • 193
  • 1
  • 2
  • 12
  • What's not working exactly? The email is sent? – andreivictor Aug 09 '14 at 10:14
  • The e-mail is send but the body text contains $field1, $field2 etc. So it is not returning the values... – Gerard Aug 09 '14 at 10:17
  • 1
    That's because you use single quotes and variables are not converted to their values. Try using double quotes: `"bla bla $field1, $field2, $field3"` – andreivictor Aug 09 '14 at 10:24
  • 1
    This is a nice topic about single quotes vs. double quotes in wordpress: http://stackoverflow.com/questions/3446216/what-is-the-difference-between-single-quoted-and-double-quoted-strings-in-php – andreivictor Aug 09 '14 at 10:28

0 Answers0