I am going through the wp-core files trying to find the file where I can edit the instructions that comes in the user confirmation email. The text looks a little like this:
Dear User,
Your new account is set up.
You can log in with the following information:
Username: MrWp
Password: thepasswork
http://mywebsite.com/wp-login.php
Thanks!
Where can find this?
Ross Wilson answers:
There is a good plugin for editing the emails: http://wordpress.org/extend/plugins/wp-better-emails/
I haven't tried it, but the original e-mail is setup as a filter. Try adding something like this to your functions.php
function new_welcome_user_msg_filter( $text ) {
if ( !$text ) {
return __( 'Dear User,
Your new account is set up.
You can log in with the following information:
Username: USERNAME
Password: PASSWORD
LOGINLINK
Thanks!
--The Team @ SITE_NAME' );
}
return $text;
}
add_filter( 'new_user_email_content', 'new_welcome_user_msg_filter' );
Thanks to John below for correcting my filter name :)
LeTune comments:
but the plugin only edits the look of the email, not their content.
LeTune comments:
Will the the username and password fill in automatically?
Ross Wilson comments:
This is the exact function from wp-includes/ms-functions.php. I am assuming it is going to fill in the username/password for you.
LeTune comments:
Any particular reason I cannot just change wp-includes/ms-functions.php?
LeTune comments:
hmmm...tried editing ms-functions.php - no change
tried adding the function to functions.php - no change
still the same ol' message.
Giri answers:
You can try this function which is working great. Add it in your functions.php file
// Redefine user notification function
if ( !function_exists('wp_new_user_notification') ) {
function wp_new_user_notification( $user_id, $plaintext_pass = '' ) {
$user = new WP_User($user_id);
$user_login = stripslashes($user->user_login);
$user_email = stripslashes($user->user_email);
$message = sprintf(__('New user registration on your blog %s:'), get_option('blogname')) . "\r\n\r\n";
$message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";
$message .= sprintf(__('E-mail: %s'), $user_email) . "\r\n";
@wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), get_option('blogname')), $message);
if ( empty($plaintext_pass) )
return;
$message = __('Hi there,') . "\r\n\r\n";
$message .= sprintf(__("Welcome to %s! Here's how to log in:"), get_option('blogname')) . "\r\n\r\n";
$message .= wp_login_url() . "\r\n";
$message .= sprintf(__('Username: %s'), $user_login) . "\r\n";
$message .= sprintf(__('Password: %s'), $plaintext_pass) . "\r\n\r\n";
$message .= sprintf(__('If you have any problems, please contact me at %s.'), get_option('admin_email')) . "\r\n\r\n";
$message .= __('Adios!');
wp_mail($user_email, sprintf(__('[%s] Your username and password'), get_option('blogname')), $message);
}
}
Original Credits: http://en.bainternet.info/
LeTune comments:
didnt work either, the email i am referring to is the second one, after the activation email.
Giri comments:
I'm not sure, But just check this plugin and give it a try.
http://epicalex.com/new-user-email-setup-update/
John Cotton answers:
Ross is almost correct...
The filter line should read:
add_filter( 'new_user_email_content', 'new_welcome_user_msg_filter' );
Julio Potier answers:
Viruthagiri Thirumavalavan got the right answer.
@Ross, your filter is used to email address changed, not user confirmation email.
Gabriel Reguly answers:
Hi LeTune,
Maybe you are looking for a database entry, in a multisite install you should search meta_key <em>welcome_user_email</em> inside table <em>wp_sitemeta</em>.
Otherwise you can change function wp_new_user_notification(), which is located in wp-includes/pluggable.php.
Source: [[LINK href="http://codex.wordpress.org/Function_Reference/wp_new_user_notification"]]http://codex.wordpress.org/Function_Reference/wp_new_user_notification[[/LINK]]
Regards,
Gabriel
idt answers:
Hi,
If all of the above suggestions didn't work for you, please try this: [[LINK href="http://wordpress.org/support/topic/how-to-change-registration-email-content"]]http://wordpress.org/support/topic/how-to-change-registration-email-content[[/LINK]]
You may also want to have a look at this plugin: [[LINK href="http://wordpress.org/extend/plugins/welcome-email-editor/"]]http://wordpress.org/extend/plugins/welcome-email-editor/[[/LINK]]
Thanks,
idt