Pass rules and used coupons to the template (#1300)