You are here

function uc_store_mail_recipient_language in Ubercart 7.3

Same name and namespace in other branches
  1. 6.2 uc_store/uc_store.module \uc_store_mail_recipient_language()

Gets the preferred language for a user's email address.

Parameters

$address: The email address to check.

Return value

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 also

user_preferred_language()

language_default()

10 calls to uc_store_mail_recipient_language()
uc_cart_complete_sale_account in uc_cart/uc_cart.module
Link a completed sale to a user.
uc_file_action_order_email in uc_file/uc_file.rules.inc
Send an email with order and file replacement tokens.
uc_order_action_email in uc_order/uc_order.rules.inc
Sends an email concerning an order.
uc_order_action_email_invoice in uc_order/uc_order.rules.inc
Emails an invoice.
uc_order_create_form_create_submit in uc_order/uc_order.admin.inc
Form submission handler for customer search.

... See full list

File

uc_store/uc_store.module, line 1867
Contains global Ubercart functions and store administration functionality.

Code

function uc_store_mail_recipient_language($address) {

  // See if any user exists for this address.
  $account = user_load_by_mail(trim($address));
  if ($account) {
    $lang_object = user_preferred_language($account);
  }
  else {
    $lang_object = language_default();
  }
  return $lang_object;
}