add logic to email