Adding email function to event module