--- role_change_notify.module	2010-05-12 19:32:11.000000000 -0700
+++ role_change_notify.module	2010-11-15 01:36:00.968562584 -0800
@@ -77,7 +77,7 @@ function role_change_notify_perm() {
  * implements hook_info to provide 'role_added/removed' op from hook_user.
  */
 function role_change_notify_hook_info() {
-  return array(
+  $triggers = array(
     'user' => array(
       'user' => array(
         'role_added' => array(
@@ -89,6 +89,17 @@ function role_change_notify_hook_info() 
       ),
     ),
   );
+
+  $roles = user_roles(TRUE);
+  unset($roles[DRUPAL_AUTHENTICATED_RID]);
+  foreach ($roles as $roleid => $rolename) {
+    $triggers['user']['user']['role_' . $roleid . '_added']['runs when'] =
+      t("When %role role is added to an account", array('%role' => $rolename));
+    $triggers['user']['user']['role_' . $roleid . '_removed']['runs when'] =
+      t("When %role role is removed from an account", array('%role' => $rolename));
+  }
+
+  return $triggers;
 }
 
 /**
@@ -97,6 +108,12 @@ function role_change_notify_hook_info() 
  */
 function role_change_notify_action_info_alter(&$info) {
   $my_hooks = array('role_added', 'role_removed');
+  $roles = user_roles(TRUE);
+  unset($roles[DRUPAL_AUTHENTICATED_RID]);
+  foreach ($roles as $roleid => $rolename) {
+    $my_hooks[] = 'role_' . $roleid . '_added';
+    $my_hooks[] = 'role_' . $roleid . '_removed';
+  }
   $actions_to_alter = array('token_actions_message_action', 'token_actions_send_email_action');
   foreach ($actions_to_alter as $action) {
     if (empty($info[$action]['hooks']['user'])) {
@@ -230,6 +247,7 @@ function role_change_notify_user_update(
     }
     // Invoke actions that should take place on role addition.
     _role_change_notify_trigger_actions('role_added', $account);
+    _role_change_notify_trigger_actions('role_' . $roleid . '_added', $account);
 
     if (variable_get("role_change_notify_$roleid", FALSE)) {
       if (valid_email_address($account->mail) && valid_email_address($from)) {
@@ -265,8 +283,10 @@ function role_change_notify_user_update(
     $role = $roles[$roleid];
     $account->rolename = $role;
     _role_change_notify_trigger_actions('role_removed', $account);
+    _role_change_notify_trigger_actions('role_' . $roleid . '_removed', $account);
   }
 }
+
 /**
  * Implementation of hook_mail().
  *
