Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/10/2021 04:14:37 PM (3 years ago)
Author:
dcavins
Message:

Add membership request-related emails and notifications.

Add 'members-membership-request' email and
'membership_request_submitted' notification
which is sent to site admins when a new request
is submitted. Also add
'members-membership-request-rejected' email
which is sent to the requester when denied.

See #8582.

t

File:
1 edited

Legend:

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

    r12929 r13168  
    279279            bp_update_to_8_0();
    280280        }
     281
     282        // Version 10.0.0.
     283        if ( $raw_db_version < 13165 ) {
     284            bp_update_to_10_0();
     285        }
     286
    281287    }
    282288
     
    700706    if ( isset( $emails['bp-members-invitation'] ) ) {
    701707        $new_emails['bp-members-invitation'] = $emails['bp-members-invitation'];
     708    }
     709
     710    return $new_emails;
     711}
     712
     713/**
     714 * 10.0.0 update routine.
     715 *
     716 * - Install new BP Emails for membership requests.
     717 *
     718 * @since 10.0.0
     719 */
     720function bp_update_to_10_0() {
     721
     722    // Install membership request emails.
     723    add_filter( 'bp_email_get_schema', 'bp_core_get_10_0_upgrade_email_schema' );
     724
     725    bp_core_install_emails();
     726
     727    remove_filter( 'bp_email_get_schema', 'bp_core_get_10_0_upgrade_email_schema' );
     728}
     729
     730/**
     731 * Select only the emails that need to be installed with version 10.0.
     732 *
     733 * @since 10.0.0
     734 *
     735 * @param array $emails The array of emails schema.
     736 */
     737function bp_core_get_10_0_upgrade_email_schema( $emails ) {
     738    $new_emails = array();
     739
     740    if ( isset( $emails['members-membership-request'] ) ) {
     741        $new_emails['members-membership-request'] = $emails['members-membership-request'];
     742    }
     743
     744    if ( isset( $emails['members-membership-request-rejected'] ) ) {
     745        $new_emails['members-membership-request-rejected'] = $emails['members-membership-request-rejected'];
    702746    }
    703747
Note: See TracChangeset for help on using the changeset viewer.