updated email functions/controller to work with the new email table

- also added date to emails