appointments status change emails templates and logic done