Home Forums Plugin Support WP User Frontend (Free Version) How to change registration Email content?

This topic is: resolved

This topic contains 14 replies, has 2 voices, and was last updated by  Bauwens 5 years, 5 months ago.

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #13100

    Bauwens
    Participant
    Post count: 15

    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 http://www.domain.com/wp-login.php

    Because they can't access this page if they are not admin.

    Thanks a lot guys

    #13199

    Tareq Hasan
    Keymaster
    Post count: 2831

    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.

    #13212

    Bauwens
    Participant
    Post count: 15

    Hey, here is the error in the console:

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

    #13274

    Tareq Hasan
    Keymaster
    Post count: 2831

    No, not that error. See the response texts.

    ajax reponse

    #13333

    Bauwens
    Participant
    Post count: 15

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

    Thanks

    #13351

    Tareq Hasan
    Keymaster
    Post count: 2831

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

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

    #13362

    Bauwens
    Participant
    Post count: 15

    i don't have that

    Image
    image

    #13374

    Tareq Hasan
    Keymaster
    Post count: 2831

    You've to click the submit button first!

    #13375

    Bauwens
    Participant
    Post count: 15

    I did !

    #13414

    Bauwens
    Participant
    Post count: 15

    No idea? Or an other solution?

    Thanks 🙂

    #13439

    Tareq Hasan
    Keymaster
    Post count: 2831

    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.

    #13440

    Bauwens
    Participant
    Post count: 15
    This reply has been marked as private.
    #13441

    Tareq Hasan
    Keymaster
    Post count: 2831

    Should be working now 🙂

    #13443

    Bauwens
    Participant
    Post count: 15

    Will give a look Thanks!

    #13460

    Bauwens
    Participant
    Post count: 15

    This is great, thanks 🙂

Viewing 15 posts - 1 through 15 (of 15 total)

The topic ‘How to change registration Email content?’ is closed to new replies.