Title: erickah's Replies | WordPress.org

---

# erickah

  [  ](https://wordpress.org/support/users/erickah/)

 *   [Profile](https://wordpress.org/support/users/erickah/)
 *   [Topics Started](https://wordpress.org/support/users/erickah/topics/)
 *   [Replies Created](https://wordpress.org/support/users/erickah/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/erickah/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/erickah/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/erickah/engagements/)
 *   [Favorites](https://wordpress.org/support/users/erickah/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Theme My Login] Auto login % redirect after registration](https://wordpress.org/support/topic/auto-login-redirect-after-registration/)
 *  [erickah](https://wordpress.org/support/users/erickah/)
 * (@erickah)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/auto-login-redirect-after-registration/#post-7333182)
 * I also wanted to auto log in the user upon registration, and encountered the 
   same problem, that the email confirmations broke. So I added one line of code
   that made the email confirmations work (see 5th line):
 *     ```
       <?php
       function auto_login_new_user( $user_id ) {
               wp_set_current_user($user_id);
               wp_set_auth_cookie($user_id);
               wp_new_user_notification( $user_id, null, 'both' );
               wp_redirect( 'http://www.example.com' );
               exit;
           }
           add_action( 'user_register', 'auto_login_new_user' );
       ?>
       ```
   
 * HOWEVER, now the email notifications are coming from the default WP setting, 
   NOT the TML custom emails. How can I send the TML emails?

Viewing 1 replies (of 1 total)