105 | | wp_mail( $new_user_email, sprintf( __( '[%s] Joining confirmation' ), wp_specialchars_decode( get_option( 'blogname' ) ) ), sprintf( $message, get_option( 'blogname' ), home_url(), wp_specialchars_decode( translate_user_role( $role['name'] ) ), home_url( "/newbloguser/$newuser_key/" ) ) ); |
| 105 | |
| 106 | |
| 107 | $new_user_email['message'] = $message; |
| 108 | $new_user_email['subject'] = sprintf( __( '[%s] Joining confirmation' ), wp_specialchars_decode( get_option( 'blogname' ) ) ); |
| 109 | $new_user_email['message'] = sprintf( $message, get_option( 'blogname' ), home_url(), wp_specialchars_decode( translate_user_role( $role['name'] ), home_url( "/newbloguser/$newuser_key/" ) ) ); |
| 110 | |
| 111 | |
| 112 | /** |
| 113 | * Filters the contents of the email sent when a new user is added. |
| 114 | * |
| 115 | * @since |
| 116 | * |
| 117 | * @param array $pass_change_email { |
| 118 | * Used to build wp_mail(). |
| 119 | * @type string $to The intended recipients. Add emails in a comma separated string. |
| 120 | * @type string $subject The subject of the email. |
| 121 | * @type string $message The content of the email. |
| 122 | * } |
| 123 | * @param array $user_id The invided user's ID |
| 124 | * @param array $role The role of invited user. |
| 125 | * @param string $newuser_key The key of the invitation. |
| 126 | * |
| 127 | */ |
| 128 | $new_user_email = apply_filters('new_user_emails',$new_user_email, $user_id, $role, $newuser_key); |
| 129 | |
| 130 | wp_mail( $new_user_email['to'], $new_user_email['subject'], $new_user_email['message'] ); |