Added email alert functionality