Skip to:
Content

BuddyPress.org

Changeset 3623


Ignore:
Timestamp:
12/30/2010 09:27:49 PM (14 years ago)
Author:
boonebgorges
Message:

Cleans up bp_core_signup_send_validation_email(). Fixes #2404. Props cnorris23. Also fixes some PHP warnings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-signup.php

    r3622 r3623  
    535535
    536536    /* Update the user_url and display_name */
    537     wp_update_user( array( 'ID' => $user_id, 'user_url' => bp_core_get_user_domain( $user_id, sanitize_title( $user_login ), $user_login ), 'display_name' => bp_core_get_user_displayname( $user_id ) ) );
     537    wp_update_user( array( 'ID' => $user_id, 'user_url' => bp_core_get_user_domain( $user_id ), 'display_name' => bp_core_get_user_displayname( $user_id ) ) );
    538538
    539539    /* Add a last active entry */
     
    619619    $activate_url = bp_get_activation_page() ."?key=$key";
    620620    $activate_url = esc_url( $activate_url );
    621     $admin_email = get_site_option( "admin_email" );
    622 
    623     if ( empty( $admin_email ) )
    624         $admin_email = 'noreply@' . $_SERVER['SERVER_NAME'];
    625 
    626     $from_name = ( '' == get_option( 'blogname' ) ) ? 'BuddyPress' : esc_html( get_option( 'blogname' ) );
    627     $message_headers = "MIME-Version: 1.0\n" . "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option( 'blog_charset' ) . "\"\n";
    628     $message = sprintf( __( 'Thanks for registering! To complete the activation of your account please click the following link:\n\n%s\n\n', 'buddypress' ), $activate_url );
     621   
     622    $from_name = ( '' == get_option( 'blogname' ) ) ? 'BuddyPress' : wp_specialchars( get_option( 'blogname' ) );
     623   
     624    $message = sprintf( __( "Thanks for registering! To complete the activation of your account please click the following link:\n\n%s\n\n", 'buddypress' ), $activate_url );
    629625    $subject = '[' . $from_name . '] ' . __( 'Activate Your Account', 'buddypress' );
    630626
    631627    /* Send the message */
    632     $to = apply_filters( 'bp_core_activation_signup_user_notification_to', $user_email, $user_id );
    633     $subject = apply_filters( 'bp_core_activation_signup_user_notification_subject', $subject, $user_id );
    634     $message = apply_filters( 'bp_core_activation_signup_user_notification_message', $message, $user_id );
    635 
    636     wp_mail( $to, $subject, $message, $message_headers );
    637 
    638     do_action( 'bp_core_sent_user_validation_email', $admin_email, $subject, $message, $user_id, $user_email, $key );
     628    $to = apply_filters( 'bp_core_signup_send_validation_email_to', $user_email, $user_id );
     629    $subject = apply_filters( 'bp_core_signup_send_validation_email_subject', $subject, $user_id );
     630    $message = apply_filters( 'bp_core_signup_send_validation_email_message', $message, $user_id, $activate_url );
     631
     632    wp_mail( $to, $subject, $message );
     633
     634    do_action( 'bp_core_sent_user_validation_email', $subject, $message, $user_id, $user_email, $key );
    639635}
    640636
Note: See TracChangeset for help on using the changeset viewer.