How to check an order status in an email template?

How to programmatically check whether an order is shipped?