move emails to controller