now using refactored email function in notifications