This topic contains 14 reply and 2 voices, and was last updated by Bauwens 5 years, 9 months ago
Viewing 14 Posts - 1 through 14 (of 14 total)
Author Posts
December 1, 2013 at 6:53 pm 13100
Bauwens Hi guys, I need to change the email content my users receive when they register. I used this way, but it is not compatible with wp-user-frontend. I explain the problem. When I use this function, the email content is good BUT there is a problem with Ajax. The user never see the green message like: Ok your account is now created. The spin (loading circle) never stops...
<?php
/*
Plugin Name: Custom New User Email
Description: Changes the copy in the email sent out to new users
*/

// 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(__('Nouvelle inscription %s:'), get_option('blogname')) . "rnrn";
		$message .= sprintf(__('Identifiant: %s'), $user_login) . "rnrn";
		$message .= sprintf(__('E-mail: %s'), $user_email) . "rn";

		@wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), get_option('blogname')), $message);

		if ( empty($plaintext_pass) )
			return;

		$message  = __('Bonjour,') . "rnrn";
		$message .= sprintf(__("Merci de vous être inscrit au site de la %s! Voici votre identifiant et mot de passe:")) . "rnrn";
		$message .= sprintf(__('Identifiant: %s'), $user_login) . "rn";
		$message .= sprintf(__('Mot de passe: %s'), $plaintext_pass) . "rnrn";
		$message .= sprintf(__('Si vous avez un problème, merci de nous contacter: %s.'), get_option('admin_email')) . "rnrn";
		$message .= __('Merci');

		wp_mail($user_email, sprintf(__('[%s] Your username and password'), get_option('blogname')), $message);

	}
}

?>
Anyone have an idea how I can do that? I just need to remove the link that looks like: to login go to www.domain.com/wp-login.php Because they can't access this page if they are not admin. Thanks a lot guys
December 3, 2013 at 3:45 pm 13199
Tareq Hasan Tareq Hasan

The problem might be in the code. Perhaps it’s generating a php error or warning and it’s messing with the JSON response that WPUF plugin needs and the loading icon never stops.

Try to view the ajax response in firebug in firefox or developer console in chrome. Seeing the response should give you the idea.

December 3, 2013 at 4:40 pm 13212
Bauwens Bauwens

Hey, here is the error in the console:

event.returnValue is deprecated. Please use the standard event.preventDefault() instead.

December 4, 2013 at 2:06 pm 13274
Tareq Hasan Tareq Hasan

No, not that error. See the response texts.

ajax reponse

December 5, 2013 at 5:10 am 13333
Bauwens Bauwens

Where to find that error ? I’m using Chrome !

Thanks

December 5, 2013 at 12:05 pm 13351
Tareq Hasan Tareq Hasan

In the response text, you’ll see the error.

Step 1: console
Step 2: Click on the link: response details with error

December 5, 2013 at 5:19 pm 13362
Bauwens Bauwens

i don’t have that

Image
image

December 5, 2013 at 9:40 pm 13374
Tareq Hasan Tareq Hasan

You’ve to click the submit button first!

December 5, 2013 at 9:41 pm 13375
Bauwens Bauwens

I did !

December 6, 2013 at 6:14 pm 13414
Bauwens Bauwens

No idea? Or an other solution?

Thanks 🙂

December 7, 2013 at 2:09 am 13439
Tareq Hasan Tareq Hasan

May be you can give me access to your site and I can see whats going on.

In that case, please provide your site url, user login and password. Also mark your reply as Private reply to keep it safe.

December 7, 2013 at 2:14 am 13440
Bauwens Bauwens This reply has been marked as private.
December 7, 2013 at 2:24 am 13441
Tareq Hasan Tareq Hasan

Should be working now 🙂

December 7, 2013 at 2:31 am 13443
Bauwens Bauwens

Will give a look Thanks!

December 7, 2013 at 4:11 pm 13460
Bauwens Bauwens

This is great, thanks 🙂

Viewing 14 Posts - 1 through 14 (of 14 total)