Index: action_email_role.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/action_email_role/action_email_role.module,v
retrieving revision 1.6
diff -u -r1.6 action_email_role.module
--- action_email_role.module	13 Sep 2008 03:28:37 -0000	1.6
+++ action_email_role.module	12 Jan 2011 05:31:19 -0000
@@ -116,6 +116,12 @@
     '#description' => t('The message that should be sent. You may include the following variables: %site_name, %uid, %node_url, %node_type, %title, %teaser, %body. Not all variables will be available in all contexts.'),
     '#required' => TRUE,
   );
+  
+  if (module_exists('token')) {
+    $form['help']['tokens'] = array(
+      '#value' => theme('token_help', 'node'),
+    );  
+  }
 
   return $form;
 }
@@ -140,6 +146,12 @@
  * Implementation of a configurable Drupal action. Sends an email to specified role(s).
  */
 function action_email_role_send_email_action($object, $context) {
+  if (module_exists('token')) {
+    $context['node'] = $object;
+    token_normalize_context($context);
+    $context['subject'] = str_replace(array("\r", "\n"), '', token_replace_multiple($context['subject'], $context));
+    $context['message'] = token_replace_multiple($context['message'], $context); 
+  }
   if ($context['node_types_set'] == 'all' || $context['node_types_selected'][$object->type]) {
     $from = variable_get('site_mail', ini_get('sendmail_from'));
     $params['object'] = $object;
