Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/23/2021 05:17:02 PM (4 years ago)
Author:
imath
Message:

Add a new BP Email to welcome new members

Once users activated their account, they are now receiving a welcome email with a link to their profile and a link to reset their password in case they forgot about it since they registered.

Props vapvarun, dcavins

Fixes #8428

File:
1 edited

Legend:

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

    r12904 r12905  
    624624    global $wpdb;
    625625    $bp_prefix = bp_core_get_table_prefix();
     626
     627    // Install welcome email to email list.
     628    add_filter( 'bp_email_get_schema', 'bp_core_get_8_0_upgrade_email_schema' );
     629
     630    bp_core_install_emails();
     631
     632    remove_filter( 'bp_email_get_schema', 'bp_core_get_8_0_upgrade_email_schema' );
    626633
    627634    // Update the `new_avatar` activity type's component to `members`.
     
    675682
    676683    bp_core_install_nonmember_opt_outs();
     684}
     685
     686/**
     687 * Select only the emails that need to be installed with version 8.0.
     688 *
     689 * @since 8.0.0
     690 *
     691 * @param array $emails The array of emails schema.
     692 */
     693function bp_core_get_8_0_upgrade_email_schema( $emails ) {
     694    $new_emails = array();
     695
     696    if ( isset( $emails['core-user-activation'] ) ) {
     697        $new_emails['core-user-activation'] = $emails['core-user-activation'];
     698    }
     699
     700    return $new_emails;
    677701}
    678702
Note: See TracChangeset for help on using the changeset viewer.