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?