how does the email alert work