=== 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-15 20:20:09 +0000
@@ -19,7 +19,7 @@
  * to token in the email.
  */
 function uc_roles_ca_entity() {
-  
+
   // CA entity for a role expiration object.
   $entities['uc_roles_expiration'] = array(
     '#title' => t('Ubercart role expiration'),
@@ -71,12 +71,12 @@
     'order' => 'order',
     'expiration' => 'expiration',
   );
-  
+
   $user_args = array(
     'user' => 'user',
     'expiration' => 'expiration',
   );
-  
+
   // Notify the user when a role is granted.
   $configurations['uc_role_notify_grant'] = array(
     '#title' => t('Notify customer when a role is granted'),
@@ -206,7 +206,7 @@
       ),
     ),
   );
-  
+
   // Send an email to a user with a role expiration
   $actions['uc_roles_user_email'] = array(
     '#title' => t('Send an order email regarding roles.'),
@@ -223,7 +223,7 @@
       ),
     ),
   );
-  
+
   return $actions;
 }
 
@@ -231,40 +231,54 @@
  * Implementation of hook_ca_trigger().
  */
 function uc_roles_ca_trigger() {
-  
-  $args = array(
-    'order' => array(
-      '#entity' => 'uc_order',
-      '#title' => t('Order'),
-    ),
-    'expiration' => array(
-      '#entity' => 'uc_roles_expiration',
-      '#title' => t('Role expiration'),
-    ),
-  );
-  
+
+  $order = array(
+    '#entity' => 'uc_order',
+    '#title' => t('Order'),
+  );
+  $account = array(
+    '#entity' => 'user',
+    '#title' => t('User'),
+  );
+  $expiration = array(
+    '#entity' => 'uc_roles_expiration',
+    '#title' => t('Role expiration'),
+  );
+
   $triggers['uc_roles_notify_grant'] = array(
     '#title' => t('E-mail for granted roles'),
     '#category' => t('Notification'),
-    '#arguments' => $args,
+    '#arguments' => array(
+      'order' => $order,
+      'expiration' => $expiration,
+    ),
   );
 
   $triggers['uc_roles_notify_revoke'] = array(
     '#title' => t('E-mail for revoked roles'),
     '#category' => t('Notification'),
-    '#arguments' => $args,
+    '#arguments' => array(
+      'user' => $account,
+      'expiration' => $expiration,
+    ),
   );
 
   $triggers['uc_roles_notify_renew'] = array(
     '#title' => t('E-mail for renewed roles'),
     '#category' => t('Notification'),
-    '#arguments' => $args,
+    '#arguments' => array(
+      'order' => $order,
+      'expiration' => $expiration,
+    ),
   );
 
   $triggers['uc_roles_notify_reminder'] = array(
     '#title' => t('E-mail for role expiration reminders'),
     '#category' => t('Notification'),
-    '#arguments' => $args,
+    '#arguments' => array(
+      'user' => $account,
+      'expiration' => $expiration,
+    ),
   );
 
   return $triggers;
@@ -351,7 +365,7 @@
  */
 function ca_build_email_form($form_state, $settings, $token_filters) {
   $form = array();
-  
+
   $form['from'] = array(
     '#type' => 'textfield',
     '#title' => t('Sender'),
@@ -445,16 +459,16 @@
         $comment = t('Customer granted user role %role.', array('%role' => _uc_roles_get_name($role->rid)));
       }
       uc_order_comment_save($order->order_id, $user->uid, $comment);
-      
+
       // Grant the role to the user.
       $expiration = _uc_roles_product_get_expiration($role, $product->qty, $existing_role->expiration);
-      
+
       // Grant the role to the user.
       uc_roles_grant($order_user, $role->rid, $expiration);
-      
+
       // Get the new expiration (if applicable)
       $new_expiration = db_fetch_object(db_query("SELECT * FROM {uc_roles_expirations} WHERE uid = %d AND rid = %d", $order_user->uid, $role->rid));
-      
+
       // Trigger role email.
       ca_pull_trigger('uc_roles_notify_'. $op, $order, $new_expiration);
     }

