How to change emails recepient with conditions?