email sending with data separation from controller to model in front end