Email controller uses a switch statement instead of ifelse struct