Clean up and add hook_cron for sending emails