? 205799_token_book_raw_not_defaulted_5.patch
? 253094_5_token_reroll.patch
? 253094_5_token_reroll_7.patch
? 278321_token_node_standards.patch
? 279989_dependencies_requirements.patch
Index: token_actions.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/token/token_actions.module,v
retrieving revision 1.4.2.3
diff -u -p -r1.4.2.3 token_actions.module
--- token_actions.module	28 Jun 2008 15:10:22 -0000	1.4.2.3
+++ token_actions.module	11 Jul 2008 21:22:58 -0000
@@ -133,15 +133,12 @@ function token_actions_send_email_action
   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);
+  $params['subject'] = str_replace(array("\r", "\n"), '', token_replace_multiple($context['subject'], $context));
+  $params['body'] = drupal_html_to_text(token_replace_multiple($context['message'], $context));
 
-  $subject = token_replace_multiple($context['subject'], $context);
-  $subject = str_replace(array("\r", "\n"), '', $subject);
-  $message = token_replace_multiple($context['message'], $context);
-  $body = drupal_html_to_text($message);
-
-  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 {
@@ -149,6 +146,11 @@ function token_actions_send_email_action
   }
 }
 
+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',
