added a function to convert events to emails