Skip to:
Content
Pages
Categories
Search
Top
Bottom

Using XProfile fields in Notification Mail

  • Avatar of cagdastakis
    cagdastakis
    Participant

    @cagdastakis

    I have a custom field in registration and asking to user membership type with radio button.
    There are two selections like “A” and “B” when he registered, as always does in wordpress, i’m getting notification email that “New User Registered on you site bla bla…” i want to add this selection to this email and see fastly which one he/she choosed.

    Ex.:
    New user registration on your site
    Username: John Doe
    Email: johndoe@gmail.com
    Membership Type: B

    Please help if you have an idea..

Viewing 1 replies (of 1 total)
  • Avatar of @modemlooper
    @modemlooper
    Moderator

    @modemlooper

    You can filter the email message. Did not test this code. It would add text to end of default message. Change field_name to exactly match name of profile field.

    function custom_activation_email_body( $message, $user_id, $key  ) {
    	
        $field1 = xprofile_get_field_data( 'field_name1', $user_id );
        $field2 = xprofile_get_field_data( 'field_name2', $user_id );
        $field3 = xprofile_get_field_data( 'field_name3', $user_id );
    
        $message .= sprintf( __( "Username: %s Email: %s Membership Type: %s", 'lang' ), $field1, $field2, $field3 );
    				
        return $message;
    	
    }
    add_filter('bp_core_signup_send_validation_email_message', 'custom_activation_email_body', 10, 3);
Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.