Skip to:
Content

BuddyPress.org

Changeset 10597


Ignore:
Timestamp:
02/16/2016 02:17:57 PM (10 years ago)
Author:
djpaul
Message:

Emails: for user/site registrations emails, set recipient name to their user_login.

For multisite and for BP_SIGNUPS_SKIP_USER_CREATION , when the user account isn't created yet, we can't fetch the user's display name. Instead, use their user_login name in the email greeting.

Fixes #6913

Props imath

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-filters.php

    r10567 r10597  
    465465                ),
    466466        );
    467         bp_send_email( 'core-user-registration-with-blog', $user_email, $args );
     467        bp_send_email( 'core-user-registration-with-blog', array( array( $user_email => $user ) ), $args );
    468468
    469469        // Return false to stop the original WPMU function from continuing.
     
    520520                ),
    521521        );
    522         bp_send_email( 'core-user-registration', $user_email, $args );
     522        bp_send_email( 'core-user-registration', array( array( $user_email => $user ) ), $args );
    523523
    524524        // Return false to stop the original WPMU function from continuing.
  • trunk/src/bp-members/bp-members-functions.php

    r10511 r10597  
    18401840                 */
    18411841                if ( apply_filters( 'bp_core_signup_send_activation_key', true, $user_id, $user_email, $activation_key, $usermeta ) ) {
    1842                         bp_core_signup_send_validation_email( $user_id, $user_email, $activation_key );
     1842                        bp_core_signup_send_validation_email( $user_id, $user_email, $activation_key, $user_login );
    18431843                }
    18441844        }
     
    22002200 * Send activation email to a newly registered user.
    22012201 *
    2202  * @param int    $user_id    ID of the new user.
    2203  * @param string $user_email Email address of the new user.
    2204  * @param string $key        Activation key.
    2205  */
    2206 function bp_core_signup_send_validation_email( $user_id, $user_email, $key ) {
     2202 * @since  2.5.0 Add the $user_login parameter.
     2203 *
     2204 * @param int|bool $user_id    ID of the new user, false if BP_SIGNUPS_SKIP_USER_CREATION is true.
     2205 * @param string   $user_email Email address of the new user.
     2206 * @param string   $key        Activation key.
     2207 * @param string   $user_login Optional. The user login name.
     2208 */
     2209function bp_core_signup_send_validation_email( $user_id, $user_email, $key, $user_login = '' ) {
    22072210        $args = array(
    22082211                'tokens' => array(
     
    22142217                ),
    22152218        );
    2216         bp_send_email( 'core-user-registration', $user_id, $args );
     2219
     2220        if ( $user_id ) {
     2221                $to = $user_id;
     2222        } else {
     2223                $to = array( array( $user_email => $user_login ) );
     2224        }
     2225
     2226        bp_send_email( 'core-user-registration', $to, $args );
    22172227}
    22182228
  • trunk/src/bp-members/classes/class-bp-signup.php

    r10417 r10597  
    587587                                // Send the validation email.
    588588                                } else {
    589                                         bp_core_signup_send_validation_email( false, $signup->user_email, $signup->activation_key );
     589                                        bp_core_signup_send_validation_email( false, $signup->user_email, $signup->activation_key, $signup->user_login );
    590590                                }
    591591                        }
Note: See TracChangeset for help on using the changeset viewer.