refactoring alert function to email array of subscribers