Skip to:
Content

BuddyPress.org

Changeset 13945


Ignore:
Timestamp:
07/05/2024 02:02:54 AM (18 months ago)
Author:
imath
Message:

Site invitations: avoid duplicate activation emails

Props dcavins, vapvarun, emaralive

Fixes #9206

Location:
trunk/src/bp-members
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-members/bp-members-invitations.php

    r13629 r13945  
    158158    );
    159159
    160     // If pending invitations exist, send the verification mail.
     160    // If pending invitations exist, but we're not currently accepting an invite, send the verification mail.
    161161    if ( $invites ) {
    162         $send = true;
     162        // Is the current request actually a response to an invitation?
     163        $maybe_inv = bp_get_members_invitation_from_request();
     164
     165        // Not currently accepting a request.
     166        if ( ! $maybe_inv->id ) {
     167            $send = true;
     168        }
    163169    }
    164170
  • trunk/src/bp-members/bp-members-membership-requests.php

    r13590 r13945  
    5151    $send = apply_filters( 'bp_members_membership_requests_bypass_manual_approval', false, $details );
    5252
    53     // If the registration process has been interrupted, this is a new membership request.
    54     if ( ! $send ) {
     53    $invites = bp_members_invitations_get_invites(
     54        array(
     55            'invitee_email' => $user_email,
     56            'invite_sent'   => 'sent'
     57        )
     58    );
     59
     60    // If the registration process has been interrupted, this is a new membership request or the user was accepting an invitation and we need not send an activation email.
     61    if ( ! $send && ! $invites ) {
    5562        $signup = bp_members_get_signup_by( 'activation_key', $activation_key );
    5663
Note: See TracChangeset for help on using the changeset viewer.