Skip to:
Content
Pages
Categories
Search
Top
Bottom

BP Profile Update Email


  • intimate1
    Participant

    @intimate1

    Hey there,

    I’d like to send an email to user that update their BuddyPress profile information. Is this possible?

    If so, how can I do this? Please be discriptive as possible as I am a PHP novice. Any guidance provided will be greatly appreciated.

    Cheers,

    C.E.

Viewing 3 replies - 1 through 3 (of 3 total)

  • danbp
    Moderator

    @danbp


    intimate1
    Participant

    @intimate1

    Yeah,

    This is a bit more advance for me?

    $admin_email = “admin@intimatencounters.com”;
    $message = sprintf( __( ‘Member: %1$s’, ‘buddypress’ ), bp_core_get_user_displayname( $user_id ) ) . “\r\n\r\n”;
    $message .= sprintf( __( ‘Color: %s’ ), bp_get_profile_field_data(‘field=Color’) ). “\r\n\r\n”;
    wp_mail( $admin_email, sprintf( __( ‘[YOUR SITE] Member Profile Update’ ), get_option(‘IntimatEncnounters’) ), $message );
    }
    
    add_action( ‘xprofile_updated_profile’, ‘rc_buddypress_profile_update’, 10, 5 );

    I have a lot of unknowns.

    For example, for line 5 do I need to include every single field? Also, for the bit of code that preceeds bp_get_profile_field_data, .= sprintf( __( ‘Color: %s’ ). Do I need to include anything in here, next to ‘Color:%s’ or leave it as is?

    For line 6, do I need to type the captitalized [YOUR SITE] exactly like this [INTIMATENCOUNTERS]?

    And lastly, for ‘blogname’ would I type ‘intimatencounters’ ?

    function rc_buddypress_profile_update( $user_id ) {

    Thanks,

    C.E.


    shanebp
    Moderator

    @shanebp

    You can put anything you want in $message

    For example:

    $subject = ' this is the subject line for the message';
    $message = 'this is the message';
    wp_mail( $admin_email, $subject, $message );

    https://codex.wordpress.org/Function_Reference/wp_mail

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘BP Profile Update Email’ is closed to new replies.
Skip to toolbar