Adds email functionality and logging.