function uc_store_mail_recipient_language in Ubercart 6.2
Same name and namespace in other branches
- 7.3 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
8 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.ca.inc - Sends an email with order and file replacement tokens.
- uc_order_action_email in uc_order/
uc_order.ca.inc - Sends an email concerning an order.
- uc_order_action_email_invoice in uc_order/
uc_order.ca.inc - Email an invoice.
- uc_order_mail_invoice_form_submit in uc_order/
uc_order.admin.inc - Form submission handler for uc_order_mail_invoice_form().
File
- uc_store/
uc_store.module, line 2273 - 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(array(
'mail' => trim($address),
));
if ($account) {
$lang_object = user_preferred_language($account);
}
else {
$lang_object = language_default();
}
return $lang_object;
}