refact mail notifacation