bp_registration_options_notify_pending_user

Emails user about pending status upon activation.

Description

bp_registration_options_notify_pending_user( (int) $user_id, (string) $key, (array) $user ); 

Parameters (3)

0. $user_id (int)
ID of the user being checked.
1. $key (string)
Activation key.
2. $user (array)
Array of user data.

Usage

  1. if ( !function_exists( 'bp_registration_options_notify_pending_user' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bp-registration-options/includes/core.php'; 
  3.  
  4. // ID of the user being checked. 
  5. $user_id = -1; 
  6.  
  7. // Activation key. 
  8. $key = ''; 
  9.  
  10. // Array of user data. 
  11. $user = array(); 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = bp_registration_options_notify_pending_user($user_id, $key, $user); 
  15.  

Defined (1)

The function is defined in the following location(s).

/includes/core.php  
  1. function bp_registration_options_notify_pending_user( $user_id, $key, $user ) { 
  2.  
  3. $user_info = get_userdata( $user_id ); 
  4. $pending_message = get_option( 'bprwg_user_pending_message' ); 
  5. $filtered_message = str_replace( '[username]', $user_info->data->user_login, $pending_message ); 
  6. $filtered_message = str_replace( '[user_email]', $user_info->data->user_email, $filtered_message ); 
  7.  
  8. /** 
  9. * Filters the message to be sent to user upon activation. 
  10. * @since 4.3.0 
  11. * @param string $filtered_message Message to be sent with placeholders changed. 
  12. * @param string $pending_message Original message before placeholders filtered. 
  13. * @param WP_User $user_info WP_User object for the newly activated user. 
  14. */ 
  15. $filtered_message = apply_filters( 'bprwg_pending_user_activation_email_message', $filtered_message, $pending_message, $user_info ); 
  16. array( 
  17. 'user_login' => $user_info->data->user_login,  
  18. 'user_email' => $user_info->data->user_email,  
  19. 'message' => $filtered_message,  
  20. );