Adding e-mail alerts code