What is the way to hook all wordpress email

Every WordPress email usually uses wp_mail(). Which is actually a wrapper of PHPMailer. Find out this wp_mail() functions documentation and source code, you’ll find some hooks there which will be useful to you cases.

But keep it in mind that, those hooks will be applicable only if the mail is sent by using wp_mail(). If any email is send by any other function like the PHP native mail() function then the hooks may not work.