Customer happiness rating on closed email tickets ONLY

Customer happiness rating on closed email tickets ONLY

How do I send a customer a happiness rating on closed email tickets only. I tried creating a workflow but it is not working. It still sends on all closed tickets.