User register hook not woring in woocom register form

Hi guys I cannot access the user email even if I do a simple echo function. It doesn’t show anything in the front, but when I hit some error and on the error page I can see the echo. What can cause this, any thoughts?

function send_coupon_to_freshly_registered_user($  user_id) {         $  user = get_user_by('id',$  user_id); //new line         $  user_email = stripslashes($  user->user_email); //changed line         echo $  user_email; } add_action('user_register', 'send_coupon_to_freshly_registered_user', 10, 1);