=== modified file 'uc_file/uc_file.ca.inc'
--- uc_file/uc_file.ca.inc	2009-05-14 21:04:36 +0000
+++ uc_file/uc_file.ca.inc	2009-08-12 15:20:40 +0000
@@ -167,9 +167,7 @@
  * @see uc_file_action_order_email_form()
  */
 function uc_file_action_order_email($order, $file_expiration, $settings) {
-
-  $account = user_load(array('uid' => $order->uid));
-  $language = language_default();
+  $account = uc_order_user_load($order);
 
   // Token replacements for the subject and body
   $settings['replacements'] = array(
@@ -188,7 +186,7 @@
 
   // Send to each recipient.
   foreach ($recipients as $email) {
-    $sent = drupal_mail('uc_order', 'action-mail', $email, $language, $settings, $settings['from']);
+    $sent = drupal_mail('uc_order', 'action-mail', $email, uc_store_mail_recipient_language($email), $settings, $settings['from']);
 
     if (!$sent['result']) {
       watchdog('ca', 'Attempt to e-mail @email concerning order @order_id failed.', array('@email' => $email, '@order_id' => $order->order_id), WATCHDOG_ERROR);

=== modified file 'uc_order/uc_order.admin.inc'
--- uc_order/uc_order.admin.inc	2009-08-05 15:44:12 +0000
+++ uc_order/uc_order.admin.inc	2009-08-12 15:20:40 +0000
@@ -1699,16 +1699,9 @@
   }
 
   $recipient = check_plain($form_state['values']['email']);
-  $account = user_load(array('uid' => $order->uid));
-  if ($account->mail == $recipient) {
-    $language = user_preferred_language($account);
-  }
-  else {
-    $language = language_default();
-  }
 
   $params = array('order' => $order);
-  $sent = drupal_mail('uc_order', 'invoice', $recipient, $language, $params, uc_store_email_from());
+  $sent = drupal_mail('uc_order', 'invoice', $recipient, uc_store_mail_recipient_language($recipient), $params);
 
   if (!$sent) {
     drupal_set_message(t('E-mail failed.'));

=== modified file 'uc_order/uc_order.ca.inc'
--- uc_order/uc_order.ca.inc	2009-07-01 15:58:50 +0000
+++ uc_order/uc_order.ca.inc	2009-08-12 15:20:40 +0000
@@ -1136,8 +1136,7 @@
  * @see uc_order_action_email_form()
  */
 function uc_order_action_email($order, $settings) {
-  $account = user_load(array('uid' => $order->uid));
-  $language = language_default();
+  $account = uc_order_user_load($order);
 
   // Token replacements for the subject and body
   $settings['replacements'] = array(
@@ -1157,7 +1156,7 @@
   }
 
   foreach ($recipients as $email) {
-    $sent = drupal_mail('uc_order', 'action-mail', $email, $language, $settings, empty($from) ? uc_store_email_from() : $from);
+    $sent = drupal_mail('uc_order', 'action-mail', $email, uc_store_mail_recipient_language($email), $settings, empty($settings['from']) ? uc_store_email_from() : $settings['from']);
 
     if (!$sent['result']) {
       watchdog('ca', 'Attempt to e-mail @email concerning order @order_id failed.', array('@email' => $email, '@order_id' => $order->order_id), WATCHDOG_ERROR);
@@ -1228,8 +1227,6 @@
  * @see uc_order_action_email_invoice_form()
  */
 function uc_order_action_email_invoice($order, $settings) {
-  $language = user_preferred_language($account);
-
   // Token replacements for the subject and body
   $settings['replacements'] = array(
     'global' => NULL,
@@ -1251,7 +1248,7 @@
   }
 
   foreach ($recipients as $email) {
-    $sent = drupal_mail('uc_order', 'action-mail', $email, $language, $settings, empty($settings['from']) ? uc_store_email_from() : $settings['from']);
+    $sent = drupal_mail('uc_order', 'action-mail', $email, uc_store_mail_recipient_language($email), $settings, empty($settings['from']) ? uc_store_email_from() : $settings['form']);
 
     if (!$sent['result']) {
       watchdog('ca', 'Attempt to e-mail invoice for order @order_id to @email failed.', array('@email' => $email, '@order_id' => $order->order_id), WATCHDOG_ERROR);

=== modified file 'uc_order/uc_order.module'
--- uc_order/uc_order.module	2009-08-04 13:24:29 +0000
+++ uc_order/uc_order.module	2009-08-12 15:20:40 +0000
@@ -520,12 +520,14 @@
  * Implementation of hook_mail().
  */
 function uc_order_mail($key, &$message, $params) {
+  $langcode = isset($message['language']) ? $message['language']->language : NULL;
+
   // Build the appropriate message paramaters based on the e-mail key.
   switch ($key) {
     // Setup an e-mailed invoice.
     case 'invoice':
       $message['headers']['Content-Type'] = 'text/html; charset=UTF-8; format=flowed';
-      $message['subject'] = t('Your Order Invoice');
+      $message['subject'] = t('Your Order Invoice', array(), $langcode);
       $message['from'] = uc_store_email_from();
       $message['body'][] = uc_order_load_invoice($params['order'], 'admin-mail', variable_get('uc_cust_order_invoice_template', 'customer'));
       break;

=== modified file 'uc_roles/uc_roles.ca.inc'
--- uc_roles/uc_roles.ca.inc	2009-07-25 00:26:00 +0000
+++ uc_roles/uc_roles.ca.inc	2009-08-12 15:20:40 +0000
@@ -303,8 +303,7 @@
  * @see uc_roles_action_order_email_form()
  */
 function uc_roles_action_order_email($order, $role_expiration, $settings) {
-  $account = user_load(array('uid' => $order->uid));
-  $language = language_default();
+  $account = uc_order_user_load($order);
 
   // Token replacements for the subject and body
   $settings['replacements'] = array(
@@ -323,7 +322,7 @@
 
   // Send to each recipient.
   foreach ($recipients as $email) {
-    $sent = drupal_mail('uc_order', 'action-mail', $email, $language, $settings, $settings['from']);
+    $sent = drupal_mail('uc_order', 'action-mail', $email, uc_store_mail_recipient_language($email), $settings, $settings['from']);
 
     if (!$sent['result']) {
       watchdog('ca', 'Attempt to e-mail @email concerning order @order_id failed.', array('@email' => $email, '@order_id' => $order->order_id), WATCHDOG_ERROR);
@@ -348,7 +347,7 @@
  * @see uc_roles_action_user_email_form()
  */
 function uc_roles_action_user_email($account, $role_expiration, $settings) {
-  $language = language_default();
+  $account = uc_order_user_load($order);
 
   // Token replacements for the subject and body
   $settings['replacements'] = array(
@@ -366,7 +365,7 @@
 
   // Send to each recipient.
   foreach ($recipients as $email) {
-    $sent = drupal_mail('uc_order', 'action-mail', $email, $language, $settings, $settings['from']);
+    $sent = drupal_mail('uc_order', 'action-mail', $email, uc_store_mail_recipient_language($email), $settings, $settings['from']);
 
     if (!$sent['result']) {
       watchdog('ca', 'Attempt to e-mail @email concerning order @order_id failed.', array('@email' => $email, '@order_id' => $order->order_id), WATCHDOG_ERROR);

=== modified file 'uc_stock/uc_stock.module'
--- uc_stock/uc_stock.module	2009-07-24 14:19:00 +0000
+++ uc_stock/uc_stock.module	2009-08-12 15:20:40 +0000
@@ -209,6 +209,8 @@
   $account = user_load(array('uid' => $order));
 
   $to = variable_get('uc_stock_threshold_notification_recipients', variable_get('uc_store_email', ini_get('sendmail_from')));
+  $to = explode(',', $to);
+
   $from = uc_store_email_from();
 
   $subject = variable_get('uc_stock_threshold_notification_subject', uc_get_message('uc_stock_threshold_notification_subject'));
@@ -217,7 +219,14 @@
   $body = variable_get('uc_stock_threshold_notification_message', uc_get_message('uc_stock_threshold_notification_message'));
   $body = token_replace_multiple($body, $token_filters);
 
-  return drupal_mail('uc_stock', 'threshold', $to, user_preferred_language($account), array('body' => $body, 'subject' => $subject) , $from, TRUE);
+  // Send to each recipient.
+  foreach ($to as $email) {
+    $sent = drupal_mail('uc_stock', 'threshold', $email, uc_store_mail_recipient_language($email), array('body' => $body, 'subject' => $subject), $from);
+
+    if (!$sent['result']) {
+      watchdog('uc_stock', 'Attempt to e-mail @email concerning stock level on sku @sku failed.', array('@email' => $email, '@sku' => $stock->sku), WATCHDOG_ERROR);
+    }
+  }
 }
 
 /**

=== modified file 'uc_store/uc_store.module'
--- uc_store/uc_store.module	2009-07-29 06:22:14 +0000
+++ uc_store/uc_store.module	2009-08-12 15:20:40 +0000
@@ -2089,6 +2089,33 @@
 }
 
 /**
+ * Get the preferred language for a user's email address.
+ *
+ * @param $address
+ *   The email address to check.
+ * @return
+ *   The language object to be used in translation, localization, etc. If a
+ *   user account can not be found for $address, language_default() is
+ *   returned.
+ *
+ * @see
+ *   user_preferred_language()
+ *   language_default()
+ */
+function uc_store_mail_recipient_language($address) {
+  // See if any user exists for this address.
+  $account = user_load(array('mail' => trim($address)));
+  if ($account) {
+    $lang_object = user_preferred_language($account);
+  }
+  // If not, site-wide default.
+  else {
+    $lang_object = language_default();
+  }
+  return $lang_object;
+}
+
+/**
  * Executes hook_uc_form_alter() implementations.
  *
  * API function to invoke hook_uc_form_alter() implementations allowing those

