diff --git a/variable_email.rules.inc b/variable_email.rules.inc
index 80d483e38..95c316588 100644
--- a/variable_email.rules.inc
+++ b/variable_email.rules.inc
@@ -96,21 +96,55 @@ function variable_email_action_mail($to, $variable, $language = 'default', $from
   
   $to = str_replace(array("\r", "\n"), '', $to);
   $from = !empty($from) ? str_replace(array("\r", "\n"), '', $from) : NULL;
-  
-  if (isset($element->settings['variable:process'])) {
-    $params['subject'] = $element->settings['variable:process']->evaluate($subject, array(), $state);
-    $params['message'] = $element->settings['variable:process']->evaluate($message, array(), $state);
-  }
-  else  {
-    $params['subject'] = $subject;
-    $params['message'] = $message;
-  }  
-  
+
+  $params['subject'] = _variable_email_evaluate_token($subject, array(), $state);
+  $params['message'] = _variable_email_evaluate_token($message, array(), $state);
+
   // Set a unique key for this mail using variable name
   $key = str_replace('_[mail_part]', '', $variable);
 
   $message = drupal_mail('variable_email', $key, $to, language_default(), $params, $from);
   if ($message['result']) {
-    watchdog('variable_email', 'Successfully sent email %subject from %from to %recipient.', array('%from' => $from, '%recipient' => $to, '%subject'=> $params['subject']));
+    watchdog('variable_email', 'Successfully sent email %subject from %from to %recipient.', array('%from' => $from, '%recipient' => $to, '%subject' => $params['subject']));
   }
 }
+
+/**
+ * Replace the tokens in the text.
+ */
+function _variable_email_evaluate_token($text, $options, RulesState $state) {
+  module_load_include('inc', 'rules', 'modules/system.eval');
+  $var_info = $state->varInfo();
+  $options += array('sanitize' => FALSE);
+  $replacements = array();
+
+  // We also support replacing tokens in a list of textual values.
+  $whole_text = is_array($text) ? implode('', $text) : $text;
+  foreach (token_scan($whole_text) as $var_name => $tokens) {
+    $var_name = str_replace('-', '_', $var_name);
+    if (isset($var_info[$var_name]) && ($token_type = _rules_system_token_map_type($var_info[$var_name]['type']))) {
+      // We have to key $data with the type token uses for the variable.
+      $data = rules_unwrap_data(array($token_type => $state->get($var_name)), array($token_type => $var_info[$var_name]));
+      $replacements += token_generate($token_type, $tokens, $data, $options);
+    }
+    else {
+      $replacements += token_generate($var_name, $tokens, array(), $options);
+    }
+    // Remove tokens if no replacement value is found. As token_replace() does
+    // if 'clear' is set.
+    $replacements += array_fill_keys($tokens, '');
+  }
+
+  // Actually apply the replacements.
+  $tokens = array_keys($replacements);
+  $values = array_values($replacements);
+
+  if (is_array($text)) {
+    foreach ($text as $i => $text_item) {
+      $text[$i] = str_replace($tokens, $values, $text_item);
+    }
+    return $text;
+  }
+
+  return str_replace($tokens, $values, $text);
+}
