Q. The condition Customer has purchased product from category XXX doesn't seems to work. Email was sent to customers that didn't have a product from category XXX in the order.
A. The condition "Customer has purchased product from category XXX" means that an email will be sent if the customer, in all of his orders in the store, has purchased a product from category sale. If you want that the condition will only test the current order, the condition should be: "Order items from category XXX".