126 | | wp_mail( |
127 | | $new_user_email, |
128 | | sprintf( |
129 | | /* translators: Joining confirmation notification email subject. %s: Site title. */ |
130 | | __( '[%s] Joining Confirmation' ), |
131 | | wp_specialchars_decode( get_option( 'blogname' ) ) |
132 | | ), |
133 | | sprintf( |
134 | | $message, |
135 | | get_option( 'blogname' ), |
136 | | home_url(), |
137 | | wp_specialchars_decode( translate_user_role( $role['name'] ) ), |
138 | | home_url( "/newbloguser/$newuser_key/" ) |
139 | | ) |
140 | | ); |
| 126 | $new_user_email['message'] = $message; |
| 127 | $new_user_email['subject'] = sprintf( __( '[%s] Joining confirmation' ), wp_specialchars_decode( get_option( 'blogname' ) ) ); |
| 128 | $new_user_email['message'] = sprintf( $message, get_option( 'blogname' ), home_url(), wp_specialchars_decode( translate_user_role( $role['name'] ), home_url( "/newbloguser/$newuser_key/" ) ) ); |
| 129 | |
| 130 | /** |
| 131 | * Filters the contents of the email sent when a new user is added. |
| 132 | * |
| 133 | * @since |
| 134 | * |
| 135 | * @param array $new_user_email { |
| 136 | * Used to build wp_mail(). |
| 137 | * @type string $to The intended recipients. Add emails in a comma separated string. |
| 138 | * @type string $subject The subject of the email. |
| 139 | * @type string $message The content of the email. |
| 140 | * } |
| 141 | * @param array $user_id The invided user's ID |
| 142 | * @param array $role The role of invited user. |
| 143 | * @param string $newuser_key The key of the invitation. |
| 144 | * |
| 145 | */ |
| 146 | |
| 147 | $new_user_email = apply_filters('new_user_emails',$new_user_email, $user_id, $role, $newuser_key); |
| 148 | |
| 149 | wp_mail( $new_user_email['to'], $new_user_email['subject'], $new_user_email['message'] ); |