Changeset 12905
- Timestamp:
- 04/23/2021 05:17:02 PM (3 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-functions.php
r12898 r12905 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}}!\n\nVisit 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.\n\nForgot your password? Don't worry, you can reset it with your email address from <a href=\"{{{lostpassword.url}}}\">this page</a> of our site", 'buddypress' ), 3736 /* translators: do not remove {} brackets or translate its contents. */ 3737 'post_excerpt' => __( "Welcome to {{site.name}}!\n\nVisit your profile, where you can tell us more about yourself, change your preferences, or make new connections, to get started: {{{profile.url}}}\n\nForgot your password? Don't worry, you can reset it with your email address from this page of our site: {{{lostpassword.url}}}", 'buddypress' ), 3738 ), 3731 3739 'activity-comment' => array( 3732 3740 /* translators: do not remove {} brackets or translate its contents. */ … … 3999 4007 'message' => __( 'You will no longer receive emails when your request to join a group has been accepted or denied.', 'buddypress' ), 4000 4008 ), 4009 ); 4010 4011 $core_user_activation = array( 4012 'description' => __( 'Recipient has successfully activated an account.', 'buddypress' ), 4001 4013 ); 4002 4014 … … 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 -
trunk/src/bp-core/bp-core-update.php
r12904 r12905 624 624 global $wpdb; 625 625 $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' ); 626 633 627 634 // Update the `new_avatar` activity type's component to `members`. … … 675 682 676 683 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 */ 693 function 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; 677 701 } 678 702 -
trunk/src/bp-members/bp-members-functions.php
r12797 r12905 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 = 0 ) { 3318 if ( ! $user_id ) { 3319 return; 3320 } 3321 3322 $profile_url = bp_core_get_user_domain( $user_id ); 3323 3324 /** 3325 * Use this filter to add/edit/remove tokens to use for your welcome email. 3326 * 3327 * @since 8.0.0 3328 * 3329 * @param array $value An array of BP Email tokens. 3330 * @param int $user_id The user ID. 3331 */ 3332 $welcome_tokens = apply_filters( 3333 'bp_send_welcome_email_tokens', 3334 array( 3335 'displayname' => bp_core_get_user_displayname( $user_id ), 3336 'profile.url' => $profile_url, 3337 'lostpassword.url' => wp_lostpassword_url( $profile_url ), 3338 ), 3339 $user_id 3340 ); 3341 3342 bp_send_email( 'core-user-activation', $user_id, array( 'tokens' => $welcome_tokens ) ); 3343 } 3344 add_action( 'bp_core_activated_user', 'bp_send_welcome_email', 10, 1 );
Note: See TracChangeset
for help on using the changeset viewer.