Conditions not working properly in notification emails