• Resolved fexnok

    (@fexnok)


    Hi,

    I’m using my own theme-my-login-custom.php with a set of functions. One of them is to display a thank you message after registration. The way I’m doing it is by the following function

    function tml_new_user_registered( $user_id ) {
        echo '<p>Thank you for registering.</p><p>Your account has been created and a verification email has been sent to your registered email address.</p><br/><p>The Team</p>';
        exit;
    }
    add_action( 'tml_new_user_registered', 'tml_new_user_registered' );

    But the welcome email is not being sent. I know is because of the exit function but if I don exit my message is not displayed.

    How can I display the message above and sent the email?

    Thanks a lot for this great plugin

    http://wordpress.org/plugins/theme-my-login/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jeff Farthing

    (@jfarthing84)

    You would need to add a higher priority than what wp_new_user_notification is attached with. I believe it is 10. So, try 11.

    add_action( 'tml_new_user_registered', 'tml_new_user_registered', 11 );
    Thread Starter fexnok

    (@fexnok)

    Hi Jeff,

    Thanks for your answer.
    I spotted that one in one of your previous posts but it’s still not working. It works when I remove the exit though. The problem is that if I remove it then it displays the login form :/

    Thread Starter fexnok

    (@fexnok)

    This is what happens if I remove the exit from the function:

    1. After user is registered it sends a request to /register/?ajax=1 the response is my thank you message
    2. The page is redirected to ?registration=complete&ajax=1

    I suppose I need to stop the page from being redirected

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘New user notification – Email not sent’ is closed to new replies.