Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Create custom message for new users */
- function custom_email_for_news_user( $wp_new_user_notification_email, $user, $blogname ) {
- $key = get_password_reset_key( $user );
- /* translators: %s: User login. */
- $custom_message = sprintf( __( 'Username: %s' ), $user->user_login ) . "\r\n\r\n";
- $custom_message .= __( 'To set your password, visit the following address:' ) . "\r\n\r\n";
- $custom_message .= network_site_url( "wp-login.php?action=rp&key=$key&login=" . rawurlencode( $user->user_login ), 'login' ) . "\r\n\r\n";
- $custom_message .= home_url() . "\r\n";
- $wp_new_user_notification_email['message'] = $custom_message;
- return $wp_new_user_notification_email;
- }
- add_filter( 'wp_new_user_notification_email', 'custom_email_for_news_user', 99, 3 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement