Moved helper functions to email_helper.py