=== modified file 'uc_file/uc_file.ca.inc'
--- uc_file/uc_file.ca.inc	2009-01-07 21:02:47 +0000
+++ uc_file/uc_file.ca.inc	2009-01-12 22:37:52 +0000
@@ -30,6 +30,37 @@
 }
 
 /**
+ * Implementation of hook_ca_condition().
+ */
+function uc_file_ca_condition() {
+  $order_arg = array(
+    '#entity' => 'uc_order',
+  );
+
+  $conditions['uc_order_has_uc_file'] = array(
+    '#title' => t('Order contains a file download'),
+    '#description' => t('Returns TRUE if the order contains any products with a file download feature.'),
+    '#category' => t('Order'),
+    '#callback' => 'uc_order_condition_has_uc_file',
+    '#arguments' => array(
+      'order' => $order_arg,
+    ),
+  );
+
+  return $conditions;
+}
+
+// Return TRUE if any order products have a file download feature
+function uc_order_condition_has_uc_file($order, $settings) {
+  foreach ($order->products as $product) {
+    $nid = db_result(db_query("SELECT nid FROM {uc_product_features} WHERE fid = 'file' AND nid = %d", $product->nid));
+    if ($nid) {
+      return TRUE;
+    }
+  }
+}
+
+/**
  * Implementation of hook_ca_predicate().
  */
 function uc_file_ca_predicate() {
@@ -54,6 +85,13 @@
             'order_status' => 'completed',
           ),
         ),
+        array(
+          '#name' => 'uc_order_has_uc_file',
+          '#title' => t('If the order contains any file downloads.'),
+          '#argument_map' => array(
+            'order' => 'updated_order',
+          ),
+        ),
       ),
     ),
     '#actions' => array(
@@ -79,6 +117,18 @@
     '#class' => 'notification',
     '#trigger' => 'uc_file_notify_grant',
     '#status' => 1,
+    '#conditions' => array(
+      '#operator' => 'AND',
+      '#conditions' => array(
+        array(
+          '#name' => 'uc_order_has_uc_file',
+          '#title' => t('If the order contains any file downloads.'),
+          '#argument_map' => array(
+            'order' => 'updated_order',
+          ),
+        ),
+      ),
+    ),
     '#actions' => array(
       array(
         '#name' => 'uc_file_order_email',

=== modified file 'uc_roles/uc_roles.ca.inc'
--- uc_roles/uc_roles.ca.inc	2008-12-20 11:46:44 +0000
+++ uc_roles/uc_roles.ca.inc	2009-01-12 22:37:43 +0000
@@ -30,6 +30,37 @@
 }
 
 /**
+ * Implementation of hook_ca_condition().
+ */
+function uc_roles_ca_condition() {
+  $order_arg = array(
+    '#entity' => 'uc_order',
+  );
+
+  $conditions['uc_order_has_uc_roles'] = array(
+    '#title' => t('Order contains a role grant'),
+    '#description' => t('Returns TRUE if the order contains any products with a role grant feature.'),
+    '#category' => t('Order'),
+    '#callback' => 'uc_order_condition_has_uc_role',
+    '#arguments' => array(
+      'order' => $order_arg,
+    ),
+  );
+
+  return $conditions;
+}
+
+// Return TRUE if any order products have a role grant feature
+function uc_order_condition_has_uc_role($order, $settings) {
+  foreach ($order->products as $product) {
+    $nid = db_result(db_query("SELECT nid FROM {uc_product_features} WHERE fid = 'role' AND nid = %d", $product->nid));
+    if ($nid) {
+      return TRUE;
+    }
+  }
+}
+
+/**
  * Implementation of hook_ca_predicate().
  */
 function uc_roles_ca_predicate() {
@@ -54,6 +85,13 @@
             'order_status' => 'completed',
           ),
         ),
+        array(
+          '#name' => 'uc_order_has_uc_roles',
+          '#title' => t('If the order contains any role grants.'),
+          '#argument_map' => array(
+            'order' => 'updated_order',
+          ),
+        ),
       ),
     ),
     '#actions' => array(
@@ -84,6 +122,18 @@
     '#class' => 'notification',
     '#trigger' => 'uc_roles_notify_grant',
     '#status' => 1,
+    '#conditions' => array(
+      '#operator' => 'AND',
+      '#conditions' => array(
+        array(
+          '#name' => 'uc_order_has_uc_roles',
+          '#title' => t('If the order contains any role grants.'),
+          '#argument_map' => array(
+            'order' => 'updated_order',
+          ),
+        ),
+      ),
+    ),
     '#actions' => array(
       array(
         '#name' => 'uc_roles_order_email',
@@ -107,6 +157,18 @@
     '#class' => 'notification',
     '#trigger' => 'uc_roles_notify_revoke',
     '#status' => 1,
+    '#conditions' => array(
+      '#operator' => 'AND',
+      '#conditions' => array(
+        array(
+          '#name' => 'uc_order_has_uc_roles',
+          '#title' => t('If the order contains any role grants.'),
+          '#argument_map' => array(
+            'order' => 'updated_order',
+          ),
+        ),
+      ),
+    ),
     '#actions' => array(
       array(
         '#name' => 'uc_roles_user_email',
@@ -130,6 +192,18 @@
     '#class' => 'notification',
     '#trigger' => 'uc_roles_notify_renew',
     '#status' => 1,
+    '#conditions' => array(
+      '#operator' => 'AND',
+      '#conditions' => array(
+        array(
+          '#name' => 'uc_order_has_uc_roles',
+          '#title' => t('If the order contains any role grants.'),
+          '#argument_map' => array(
+            'order' => 'updated_order',
+          ),
+        ),
+      ),
+    ),
     '#actions' => array(
       array(
         '#name' => 'uc_roles_order_email',
@@ -153,6 +227,18 @@
     '#class' => 'notification',
     '#trigger' => 'uc_roles_notify_reminder',
     '#status' => 1,
+    '#conditions' => array(
+      '#operator' => 'AND',
+      '#conditions' => array(
+        array(
+          '#name' => 'uc_order_has_uc_roles',
+          '#title' => t('If the order contains any role grants.'),
+          '#argument_map' => array(
+            'order' => 'updated_order',
+          ),
+        ),
+      ),
+    ),
     '#actions' => array(
       array(
         '#name' => 'uc_roles_user_email',

