diff --git src/bp-core/bp-core-functions.php src/bp-core/bp-core-functions.php
index afb941bf8..9a923b0b1 100644
|
|
|
function bp_email_get_schema() {
|
| 3728 | 3728 | * @param array $emails The array of emails schema. |
| 3729 | 3729 | */ |
| 3730 | 3730 | return (array) apply_filters( 'bp_email_get_schema', array( |
| | 3731 | 'core-user-activation' => array( |
| | 3732 | /* translators: do not remove {} brackets or translate its contents. */ |
| | 3733 | 'post_title' => __( '[{{{site.name}}}] Welcome!', 'buddypress' ), |
| | 3734 | /* translators: do not remove {} brackets or translate its contents. */ |
| | 3735 | 'post_content' => __( "Welcome to [{{{site.name}}}]! Visit your <a href=\"{{{profile.url}}}\">profile</a>, where you can tell us more about yourself, change your preferences, or make new connections, to get started.", 'buddypress' ), |
| | 3736 | /* translators: do not remove {} brackets or translate its contents. */ |
| | 3737 | 'post_excerpt' => __( "Welcome to [{{{site.name}}}]! Visit your profile, where you can tell us more about yourself, change your preferences, or make new connections, to get started: {{{profile.url}}}", 'buddypress' ), |
| | 3738 | ), |
| 3731 | 3739 | 'activity-comment' => array( |
| 3732 | 3740 | /* translators: do not remove {} brackets or translate its contents. */ |
| 3733 | 3741 | 'post_title' => __( '[{{{site.name}}}] {{poster.name}} replied to one of your updates', 'buddypress' ), |
| … |
… |
function bp_email_get_type_schema( $field = 'description' ) {
|
| 4000 | 4008 | ), |
| 4001 | 4009 | ); |
| 4002 | 4010 | |
| | 4011 | $core_user_activation = array( |
| | 4012 | 'description' => __( 'Recipient has successfully activated an account.', 'buddypress' ), |
| | 4013 | ); |
| | 4014 | |
| 4003 | 4015 | $types = array( |
| 4004 | 4016 | 'activity-comment' => $activity_comment, |
| 4005 | 4017 | 'activity-comment-author' => $activity_comment_author, |
| … |
… |
function bp_email_get_type_schema( $field = 'description' ) {
|
| 4017 | 4029 | 'settings-verify-email-change' => $settings_verify_email_change, |
| 4018 | 4030 | 'groups-membership-request-accepted' => $groups_membership_request_accepted, |
| 4019 | 4031 | 'groups-membership-request-rejected' => $groups_membership_request_rejected, |
| | 4032 | 'core-user-activation' => $core_user_activation, |
| 4020 | 4033 | ); |
| 4021 | 4034 | |
| 4022 | 4035 | if ( $field !== 'all' ) { |
diff --git src/bp-core/bp-core-update.php src/bp-core/bp-core-update.php
index 1556f6146..633da88cb 100644
|
|
|
function bp_update_to_8_0() {
|
| 606 | 606 | global $wpdb; |
| 607 | 607 | $bp_prefix = bp_core_get_table_prefix(); |
| 608 | 608 | |
| | 609 | // Install welcome email to email list. |
| | 610 | add_filter( 'bp_email_get_schema', 'bp_core_get_8_0_upgrade_email_schema' ); |
| | 611 | |
| | 612 | bp_core_install_emails(); |
| | 613 | |
| | 614 | remove_filter( 'bp_email_get_schema', 'bp_core_get_8_0_upgrade_email_schema' ); |
| | 615 | |
| 609 | 616 | // Update the `new_avatar` activity type's component to `members`. |
| 610 | 617 | $wpdb->update( |
| 611 | 618 | $bp_prefix . 'bp_activity', |
| … |
… |
function bp_update_to_8_0() {
|
| 655 | 662 | bp_core_install_nonmember_opt_outs(); |
| 656 | 663 | } |
| 657 | 664 | |
| | 665 | /** |
| | 666 | * Select only the emails that need to be installed with version 8.0. |
| | 667 | * |
| | 668 | * @since 8.0.0 |
| | 669 | * |
| | 670 | * @param array $emails The array of emails schema. |
| | 671 | */ |
| | 672 | function bp_core_get_8_0_upgrade_email_schema( $emails ) { |
| | 673 | $new_emails = array(); |
| | 674 | if ( isset( $emails['core-user-activation'] ) ) { |
| | 675 | $new_emails['core-user-activation'] = $emails['core-user-activation']; |
| | 676 | } |
| | 677 | return $new_emails; |
| | 678 | } |
| | 679 | |
| 658 | 680 | /** |
| 659 | 681 | * Updates the component field for new_members type. |
| 660 | 682 | * |
diff --git src/bp-members/bp-members-functions.php src/bp-members/bp-members-functions.php
index 165bc97c3..5f51f853a 100644
|
|
|
function bp_members_avatar_upload_dir( $directory = 'avatars', $user_id = 0 ) {
|
| 3306 | 3306 | 'error' => false |
| 3307 | 3307 | ) ); |
| 3308 | 3308 | } |
| | 3309 | |
| | 3310 | /** |
| | 3311 | * Send welcome email on successful user activation. |
| | 3312 | * |
| | 3313 | * @since 8.0.0 |
| | 3314 | * |
| | 3315 | * @param int $user_id The new user's ID |
| | 3316 | */ |
| | 3317 | function bp_send_welcome_email( $user_id ){ |
| | 3318 | // Add tokens to parse in email |
| | 3319 | $args = array( |
| | 3320 | 'tokens' => array( |
| | 3321 | 'displayname' => bp_core_get_user_displayname( $user_id ), |
| | 3322 | 'profile.url' => bp_core_get_user_domain( $user_id ) |
| | 3323 | ), |
| | 3324 | ); |
| | 3325 | |
| | 3326 | bp_send_email( 'core-user-activation', $user_id, $args ); |
| | 3327 | } |
| | 3328 | add_action( 'bp_core_activated_user', 'bp_send_welcome_email' ); |