Index: token_actions.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/token/token_actions.module,v
retrieving revision 1.4.2.1
diff -u -r1.4.2.1 token_actions.module
--- token_actions.module	4 May 2008 22:51:37 -0000	1.4.2.1
+++ token_actions.module	7 May 2008 21:06:12 -0000
@@ -122,15 +122,13 @@
   if (!empty($context['node']) && empty($context['user'])) {
     $context['user'] = user_load(array('uid' => $context['node']->uid));
   }
-  $from = variable_get('site_mail', ini_get('sendmail_from'));
+  $params['from'] = variable_get('site_mail', ini_get('sendmail_from'));
   $recipient = token_replace_multiple($context['recipient'], $context);
 
-  $subject = token_replace_all($context['subject'], $context);
-  $subject = str_replace(array("\r", "\n"), '', $subject);
-  $message = token_replace_all($context['message'], $context);
-  $body = drupal_html_to_text($message);
+  $params['subject'] = str_replace(array("\r", "\n"), '', token_replace_multiple($context['subject'], $context));
+  $params['message'] = drupal_html_to_text(token_replace_multiple($context['message'], $context));
 
-  if (drupal_mail('action_send_email', $recipient, $subject, $body, $from )) {
+  if (drupal_mail('token_actions', 'action_send_email', $recipient, language_default(), $params)) {
     watchdog('action', 'Sent email to %recipient', array('%recipient' => $recipient));
   }
   else {
@@ -138,6 +136,11 @@
   }
 }
 
+function token_actions_mail($key, &$message, $params) {
+  $message['subject'] = $params['subject']
+  $message['body'] = $params['body'];
+}
+
 function token_actions_message_action_form($context) {
   $form['message'] = array(
     '#type' => 'textarea',
