[-] BO & FO & MO : #PSCFI-4237 : adding id_lang in method l() of class Mail()

This commit is contained in:
lLefevre
2011-12-05 17:22:47 +00:00
parent 8167ef6f50
commit 1c32791fa0
16 changed files with 32 additions and 32 deletions
+1 -1
View File
@@ -644,7 +644,7 @@ class CustomerCore extends ObjectModel
Mail::Send(
(int)$id_lang,
'guest_to_customer',
Mail::l('Your guest account has been transformed to customer account'),
Mail::l('Your guest account has been transformed to customer account', (int)$id_lang),
$vars,
$this->email,
$this->firstname.' '.$this->lastname
+1 -1
View File
@@ -92,7 +92,7 @@ class LoggerCore extends ObjectModel
Mail::Send(
(int)Configuration::get('PS_LANG_DEFAULT'),
'log_alert',
Mail::l('Log: You have a new alert from your shop'),
Mail::l('Log: You have a new alert from your shop', (int)Configuration::get('PS_LANG_DEFAULT')),
array(),
Configuration::get('PS_SHOP_EMAIL')
);
+1 -1
View File
@@ -317,7 +317,7 @@ abstract class PaymentModuleCore extends Module
$params['{firstname}'] = $customer->firstname;
$params['{lastname}'] = $customer->lastname;
$params['{id_order}'] = $order->id;
Mail::Send((int)$order->id_lang, 'voucher', Mail::l('New voucher regarding your order #').$order->id, $params, $customer->email, $customer->firstname.' '.$customer->lastname);
Mail::Send((int)$order->id_lang, 'voucher', Mail::l('New voucher regarding your order #', (int)$order->id_lang).$order->id, $params, $customer->email, $customer->firstname.' '.$customer->lastname);
}
}
@@ -295,7 +295,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
if (Mail::Send(
$this->context->language->id,
'forward_msg',
Mail::l('Fwd: Customer message'),
Mail::l('Fwd: Customer message', $this->context->language->id),
$params,
$employee->email,
$employee->firstname.' '.$employee->lastname,
@@ -317,7 +317,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
if (Mail::Send(
(int)$cookie->id_lang,
'forward_msg',
Mail::l('Fwd: Customer message'),
Mail::l('Fwd: Customer message', (int)$cookie->id_lang),
$params, $email, null,
$current_employee->email, $current_employee->firstname.' '.$current_employee->lastname,
null, null, _PS_MAIL_DIR_, true))
@@ -359,7 +359,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
if (Mail::Send(
$ct->id_lang,
'reply_msg',
Mail::l('An answer to your message is available').' #ct'.$ct->id.'#tc'.$ct->token,
Mail::l('An answer to your message is available', $ct->id_lang).' #ct'.$ct->id.'#tc'.$ct->token,
$params, Tools::getValue('msg_email'), null, null, null, $file_attachment, null,
_PS_MAIL_DIR_, true))
{
+1 -1
View File
@@ -194,7 +194,7 @@ class AdminLoginControllerCore extends AdminController
'{passwd}' => $pwd
);
if (Mail::Send((int)Configuration::get('PS_LANG_DEFAULT'), 'password', Mail::l('Your new admin password'), $params, $employee->email, $employee->firstname.' '.$employee->lastname))
if (Mail::Send((int)Configuration::get('PS_LANG_DEFAULT'), 'password', Mail::l('Your new admin password', (int)Configuration::get('PS_LANG_DEFAULT')), $params, $employee->email, $employee->firstname.' '.$employee->lastname))
die(Tools::jsonEncode(array('hasErrors' => false, 'confirm' => $this->l('Your password has been e-mailed to you'))));
else
die(Tools::jsonEncode(array('hasErrors' => true, 'errors' => array(Tools::displayError('An error occurred during your password change.')))));
+5 -5
View File
@@ -195,7 +195,7 @@ class AdminOrdersControllerCore extends AdminController
'{lastname}' => $customer->lastname,
'{id_order}' => (int)$order->id
);
@Mail::Send((int)$order->id_lang, 'in_transit', Mail::l('Package in transit'), $templateVars,
@Mail::Send((int)$order->id_lang, 'in_transit', Mail::l('Package in transit', (int)$order->id_lang), $templateVars,
$customer->email, $customer->firstname.' '.$customer->lastname, NULL, NULL, NULL, NULL,
_PS_MAIL_DIR_, true);
Tools::redirectAdmin(self::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=4&token='.$this->token);
@@ -317,8 +317,8 @@ class AdminOrdersControllerCore extends AdminController
'{id_order}' => $order->id,
'{message}' => (Configuration::get('PS_MAIL_TYPE') == 2 ? $cm->message : Tools::nl2br($cm->message))
);
if (@Mail::Send((int)($order->id_lang), 'order_merchant_comment',
Mail::l('New message regarding your order'), $varsTpl, $customer->email,
if (@Mail::Send((int)$order->id_lang, 'order_merchant_comment',
Mail::l('New message regarding your order', (int)$order->id_lang), $varsTpl, $customer->email,
$customer->firstname.' '.$customer->lastname, NULL, NULL, NULL, NULL, _PS_MAIL_DIR_, true))
Tools::redirectAdmin(self::$currentIndex.'&id_order='.$id_order.'&vieworder&conf=11'.'&token='.$this->token);
}
@@ -501,7 +501,7 @@ class AdminOrdersControllerCore extends AdminController
$currency = $this->context->currency;
$params['{voucher_amount}'] = Tools::displayPrice($voucher->value, $currency, false);
$params['{voucher_num}'] = $voucher->name;
@Mail::Send((int)($order->id_lang), 'voucher', Mail::l('New voucher regarding your order'),
@Mail::Send((int)$order->id_lang, 'voucher', Mail::l('New voucher regarding your order', (int)$order->id_lang),
$params, $customer->email, $customer->firstname.' '.$customer->lastname, NULL, NULL, NULL,
NULL, _PS_MAIL_DIR_, true);
}
@@ -854,7 +854,7 @@ class AdminOrdersControllerCore extends AdminController
$mailVars = array('{order_link}' => Context::getContext()->link->getPageLink('order', false, (int)$cart->id_lang, 'step=3&recover_cart='.(int)$cart->id.'&token_cart='.md5(_COOKIE_KEY_.'recover_cart_'.(int)$cart->id)),
'{firstname}' => $customer->firstname,
'{lastname}' => $customer->lastname,);
if (Mail::Send((int)$cart->id_lang, 'backoffice_order', Mail::l('Process the payment of your order'), $mailVars, $customer->email, $customer->firstname.' '.$customer->lastname, NULL, NULL, NULL, NULL,_PS_MAIL_DIR_, true))
if (Mail::Send((int)$cart->id_lang, 'backoffice_order', Mail::l('Process the payment of your order', (int)$cart->id_lang), $mailVars, $customer->email, $customer->firstname.' '.$customer->lastname, NULL, NULL, NULL, NULL,_PS_MAIL_DIR_, true))
die(Tools::jsonEncode(array('errors' => false, 'result' => $this->l('The mail was sent to your customer.'))));
}
}
+3 -3
View File
@@ -429,7 +429,7 @@ class Blocknewsletter extends Module
*/
protected function sendVoucher($email, $code)
{
return Mail::Send($this->context->language->id, 'newsletter_voucher', Mail::l('Newsletter voucher'), array('{discount}' => $code), $email, null, null, null, null, null, dirname(__FILE__).'/mails/');
return Mail::Send($this->context->language->id, 'newsletter_voucher', Mail::l('Newsletter voucher', $this->context->language->id), array('{discount}' => $code), $email, null, null, null, null, null, dirname(__FILE__).'/mails/');
}
/**
@@ -439,7 +439,7 @@ class Blocknewsletter extends Module
*/
protected function sendConfirmationEmail($email)
{
return Mail::Send($this->context->language->id, 'newsletter_conf', Mail::l('Newsletter confirmation'), array(), pSQL($email), null, null, null, null, null, dirname(__FILE__).'/mails/');
return Mail::Send($this->context->language->id, 'newsletter_conf', Mail::l('Newsletter confirmation', $this->context->language->id), array(), pSQL($email), null, null, null, null, null, dirname(__FILE__).'/mails/');
}
/**
@@ -451,7 +451,7 @@ class Blocknewsletter extends Module
protected function sendVerificationEmail($email, $token)
{
$verif_url = Tools::getShopDomain(true)._MODULE_DIR_.$this->name.'/verification.php?token='.$token;
return Mail::Send($this->context->language->id, 'newsletter_verif', Mail::l('Email verification'), array('{verif_url}' => $verif_url), $email, null, null, null, null, null, dirname(__FILE__).'/mails/');
return Mail::Send($this->context->language->id, 'newsletter_verif', Mail::l('Email verification', $this->context->language->id), array('{verif_url}' => $verif_url), $email, null, null, null, null, null, dirname(__FILE__).'/mails/');
}
public function hookDisplayRightColumn($params)
+1 -1
View File
@@ -64,7 +64,7 @@ if ($context->customer->isLogged())
srand($s * $us);
$wishlist->token = strtoupper(substr(sha1(uniqid(rand(), true)._COOKIE_KEY_.$context->customer->id), 0, 16));
$wishlist->add();
Mail::Send($context->language->id, 'wishlink', Mail::l('Your wishlist\'s link'),
Mail::Send($context->language->id, 'wishlink', Mail::l('Your wishlist\'s link', $context->language->id),
array(
'{wishlist}' => $wishlist->name,
'{message}' => Tools::getProtocol().htmlentities($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').__PS_BASE_URI__.'modules/blockwishlist/view.php?token='.$wishlist->token),
+1 -1
View File
@@ -52,7 +52,7 @@ if ($context->customer->isLogged())
$toName = strval(Configuration::get('PS_SHOP_NAME'));
$customer = $context->customer;
if (Validate::isLoadedObject($customer))
Mail::Send($context->language->id, 'wishlist', Mail::l('Message from ').$customer->lastname.' '.$customer->firstname,
Mail::Send($context->language->id, 'wishlist', Mail::l('Message from ', $context->language->id).$customer->lastname.' '.$customer->firstname,
array(
'{lastname}' => $customer->lastname,
'{firstname}' => $customer->firstname,
+4 -4
View File
@@ -296,7 +296,7 @@ class Followup extends Module
if ($voucher !== false)
{
$templateVars = array('{email}' => $email['email'], '{lastname}' => $email['lastname'], '{firstname}' => $email['firstname'], '{amount}' => $conf['PS_FOLLOW_UP_AMOUNT_1'], '{days}' => $conf['PS_FOLLOW_UP_DAYS_1'], '{voucher_num}' => $voucher->name);
$result = Mail::Send((int)($email['id_lang']), 'followup_1', Mail::l('Your cart and your discount', $email['id_lang']), $templateVars, $email['email'], $email['firstname'].' '.$email['lastname'], NULL, NULL, NULL, NULL, dirname(__FILE__).'/mails/');
$result = Mail::Send((int)$email['id_lang'], 'followup_1', Mail::l('Your cart and your discount', (int)$email['id_lang']), $templateVars, $email['email'], $email['firstname'].' '.$email['lastname'], NULL, NULL, NULL, NULL, dirname(__FILE__).'/mails/');
$this->logEmail(1, (int)($voucher->id), (int)($email['id_customer']), (int)($email['id_cart']));
}
}
@@ -367,7 +367,7 @@ class Followup extends Module
if ($voucher !== false)
{
$templateVars = array('{email}' => $email['email'], '{lastname}' => $email['lastname'], '{firstname}' => $email['firstname'], '{amount}' => $conf['PS_FOLLOW_UP_AMOUNT_2'], '{days}' => $conf['PS_FOLLOW_UP_DAYS_2'], '{voucher_num}' => $voucher->name);
$result = Mail::Send((int)($email['id_lang']), 'followup_2', Mail::l('Thanks for your order', $email['id_lang']), $templateVars, $email['email'], $email['firstname'].' '.$email['lastname'], NULL, NULL, NULL, NULL, dirname(__FILE__).'/mails/');
$result = Mail::Send((int)$email['id_lang'], 'followup_2', Mail::l('Thanks for your order', (int)$email['id_lang']), $templateVars, $email['email'], $email['firstname'].' '.$email['lastname'], NULL, NULL, NULL, NULL, dirname(__FILE__).'/mails/');
$this->logEmail(2, (int)($voucher->id), (int)($email['id_customer']), (int)($email['id_cart']));
}
}
@@ -404,7 +404,7 @@ class Followup extends Module
if ($voucher !== false)
{
$templateVars = array('{email}' => $email['email'], '{lastname}' => $email['lastname'], '{firstname}' => $email['firstname'], '{amount}' => $conf['PS_FOLLOW_UP_AMOUNT_3'], '{days}' => $conf['PS_FOLLOW_UP_DAYS_3'], '{voucher_num}' => $voucher->name);
$result = Mail::Send((int)($email['id_lang']), 'followup_3', Mail::l('You are one of our best customers', $email['id_lang']), $templateVars, $email['email'], $email['firstname'].' '.$email['lastname'], NULL, NULL, NULL, NULL, dirname(__FILE__).'/mails/');
$result = Mail::Send((int)$email['id_lang'], 'followup_3', Mail::l('You are one of our best customers', (int)$email['id_lang']), $templateVars, $email['email'], $email['firstname'].' '.$email['lastname'], NULL, NULL, NULL, NULL, dirname(__FILE__).'/mails/');
$this->logEmail(3, (int)($voucher->id), (int)($email['id_customer']), (int)($email['id_cart']));
}
}
@@ -447,7 +447,7 @@ class Followup extends Module
if ($voucher !== false)
{
$templateVars = array('{email}' => $email['email'], '{lastname}' => $email['lastname'], '{firstname}' => $email['firstname'], '{amount}' => $conf['PS_FOLLOW_UP_AMOUNT_4'], '{days}' => $conf['PS_FOLLOW_UP_DAYS_4'], '{days_threshold}' => (int)(Configuration::get('PS_FOLLOW_UP_DAYS_THRESHOLD_4')), '{voucher_num}' => $voucher->name);
$result = Mail::Send((int)($email['id_lang']), 'followup_4', Mail::l('We miss you', $email['id_lang']), $templateVars, $email['email'], $email['firstname'].' '.$email['lastname'], NULL, NULL, NULL, NULL, dirname(__FILE__).'/mails/');
$result = Mail::Send((int)$email['id_lang'], 'followup_4', Mail::l('We miss you', (int)$email['id_lang']), $templateVars, $email['email'], $email['firstname'].' '.$email['lastname'], NULL, NULL, NULL, NULL, dirname(__FILE__).'/mails/');
$this->logEmail(4, (int)($voucher->id), (int)($email['id_customer']), (int)($email['id_cart']));
}
}
+4 -4
View File
@@ -185,7 +185,7 @@ class MailAlerts extends Module
// Filling-in vars for email
$template = 'new_order';
$subject = $this->l('New order').' - '.sprintf('%06d', $order->id);
$subject = $this->l('New order', (int)$id_lang).' - '.sprintf('%06d', $order->id);
$templateVars = array(
'{firstname}' => $customer->firstname,
'{lastname}' => $customer->lastname,
@@ -238,7 +238,7 @@ class MailAlerts extends Module
);
$iso = Language::getIsoById((int)($id_lang));
if (file_exists(dirname(__FILE__).'/mails/'.$iso.'/'.$template.'.txt') AND file_exists(dirname(__FILE__).'/mails/'.$iso.'/'.$template.'.html'))
Mail::Send($id_lang, $template, $subject, $templateVars, explode(self::__MA_MAIL_DELIMITOR__, $this->_merchant_mails), NULL, $configuration['PS_SHOP_EMAIL'], $configuration['PS_SHOP_NAME'], NULL, NULL, dirname(__FILE__).'/mails/');
Mail::Send((int)$id_lang, $template, $subject, $templateVars, explode(self::__MA_MAIL_DELIMITOR__, $this->_merchant_mails), NULL, $configuration['PS_SHOP_EMAIL'], $configuration['PS_SHOP_NAME'], NULL, NULL, dirname(__FILE__).'/mails/');
}
@@ -308,7 +308,7 @@ class MailAlerts extends Module
if ($params['product']['active'] == 1)
{
if (file_exists(dirname(__FILE__).'/mails/'.$iso.'/productoutofstock.txt') AND file_exists(dirname(__FILE__).'/mails/'.$iso.'/productoutofstock.html'))
Mail::Send((int)Configuration::get('PS_LANG_DEFAULT'), 'productoutofstock', Mail::l('Product out of stock'), $templateVars, explode(self::__MA_MAIL_DELIMITOR__, $this->_merchant_mails), NULL, strval(Configuration::get('PS_SHOP_EMAIL')), strval(Configuration::get('PS_SHOP_NAME')), NULL, NULL, dirname(__FILE__).'/mails/');
Mail::Send((int)Configuration::get('PS_LANG_DEFAULT'), 'productoutofstock', Mail::l('Product out of stock', (int)Configuration::get('PS_LANG_DEFAULT')), $templateVars, explode(self::__MA_MAIL_DELIMITOR__, $this->_merchant_mails), NULL, strval(Configuration::get('PS_SHOP_EMAIL')), strval(Configuration::get('PS_SHOP_NAME')), NULL, NULL, dirname(__FILE__).'/mails/');
}
}
if ($this->_customer_qty AND $params['product']['quantity'] > 0)
@@ -362,7 +362,7 @@ class MailAlerts extends Module
$iso = $this->context->language->iso_code;
if (file_exists(dirname(__FILE__).'/mails/'.$iso.'/customer_qty.txt') AND file_exists(dirname(__FILE__).'/mails/'.$iso.'/customer_qty.html'))
Mail::Send((int)(Configuration::get('PS_LANG_DEFAULT')), 'customer_qty', Mail::l('Product available'), $templateVars, strval($customer_email), NULL, strval(Configuration::get('PS_SHOP_EMAIL')), strval(Configuration::get('PS_SHOP_NAME')), NULL, NULL, dirname(__FILE__).'/mails/');
Mail::Send((int)Configuration::get('PS_LANG_DEFAULT'), 'customer_qty', Mail::l('Product available', (int)Configuration::get('PS_LANG_DEFAULT')), $templateVars, strval($customer_email), NULL, strval(Configuration::get('PS_SHOP_EMAIL')), strval(Configuration::get('PS_SHOP_NAME')), NULL, NULL, dirname(__FILE__).'/mails/');
if ($customer_id)
$customer_email = 0;
self::deleteAlert((int)$customer_id, strval($customer_email), (int)$id_product, (int)$id_product_attribute);
+1 -1
View File
@@ -179,7 +179,7 @@ function submitAccount()
$errors[] = Tools::displayError('an error occurred while creating your address');
else
{
if (Mail::Send($context->language->id, 'account', Mail::l('Welcome!'),
if (Mail::Send($context->language->id, 'account', Mail::l('Welcome!', $context->language->id),
array('{firstname}' => $customer->firstname, '{lastname}' => $customer->lastname, '{email}' => $customer->email, '{passwd}' => Tools::getValue('passwd')), $customer->email, $customer->firstname.' '.$customer->lastname))
$context->smarty->assign('confirmation', 1);
$context->cookie->id_customer = (int)($customer->id);
+1 -1
View File
@@ -648,7 +648,7 @@ class PayPal extends PaymentModule
$this->context->smarty->assign('logs', $log);
$data = array('{logs}' => implode('<br />', $log));
if ($send)
Mail::Send($this->context->language->id, 'error_reporting', Mail::l('Error reporting from your PayPal module'), $data, Configuration::get('PS_SHOP_EMAIL'), NULL, NULL, NULL, NULL, NULL, _PS_MODULE_DIR_.$this->name.'/mails/');
Mail::Send($this->context->language->id, 'error_reporting', Mail::l('Error reporting from your PayPal module', $this->context->language->id), $data, Configuration::get('PS_SHOP_EMAIL'), NULL, NULL, NULL, NULL, NULL, _PS_MODULE_DIR_.$this->name.'/mails/');
echo $this->display(__FILE__, 'error.tpl');
include_once(dirname(__FILE__).'/../../footer.php');
die;
@@ -103,7 +103,7 @@ if (Tools::isSubmit('submitSponsorFriends') AND Tools::getValue('friendsEmail')
'{firstname_friend}' => $friendFirstName,
'{link}' => 'authentication.php?create_account=1&sponsor='.urlencode($cipherTool->encrypt($referralprogram->id.'|'.$referralprogram->email.'|')),
'{discount}' => $discount);
Mail::Send((int)($cookie->id_lang), 'referralprogram-invitation', Mail::l('Referral Program'), $vars, $friendEmail, $friendFirstName.' '.$friendLastName, strval(Configuration::get('PS_SHOP_EMAIL')), strval(Configuration::get('PS_SHOP_NAME')), NULL, NULL, dirname(__FILE__).'/mails/');
Mail::Send((int)$cookie->id_lang, 'referralprogram-invitation', Mail::l('Referral Program', (int)$cookie->id_lang), $vars, $friendEmail, $friendFirstName.' '.$friendLastName, strval(Configuration::get('PS_SHOP_EMAIL')), strval(Configuration::get('PS_SHOP_NAME')), NULL, NULL, dirname(__FILE__).'/mails/');
$invitation_sent = true;
$nbInvitation++;
$activeTab = 'pending';
@@ -151,7 +151,7 @@ if (Tools::isSubmit('revive'))
'{discount}' => $discount
);
$referralprogram->save();
Mail::Send((int)($cookie->id_lang), 'referralprogram-invitation', Mail::l('Referral Program'), $vars, $referralprogram->email, $referralprogram->firstname.' '.$referralprogram->lastname, strval(Configuration::get('PS_SHOP_EMAIL')), strval(Configuration::get('PS_SHOP_NAME')), NULL, NULL, dirname(__FILE__).'/mails/');
Mail::Send((int)$cookie->id_lang, 'referralprogram-invitation', Mail::l('Referral Program', (int)$cookie->id_lang), $vars, $referralprogram->email, $referralprogram->firstname.' '.$referralprogram->lastname, strval(Configuration::get('PS_SHOP_EMAIL')), strval(Configuration::get('PS_SHOP_NAME')), NULL, NULL, dirname(__FILE__).'/mails/');
$revive_sent = true;
$nbRevive++;
}
+2 -2
View File
@@ -479,7 +479,7 @@ class ReferralProgram extends Module
Mail::Send(
(int)$cookie->id_lang,
'referralprogram-voucher',
Mail::l('Congratulations!'),
Mail::l('Congratulations!', (int)$cookie->id_lang),
$data,
$newCustomer->email,
$newCustomer->firstname.' '.$newCustomer->lastname,
@@ -614,7 +614,7 @@ class ReferralProgram extends Module
$currency = new Currency((int)$order->id_currency);
$discount_display = ReferralProgram::displayDiscount($cartRule->reduction_percent ? $cartRule->reduction_percent : $cartRule->reduction_amount, $cartRule->reduction_percent ? 1 : 2, $currency);
$data = array('{sponsored_firstname}' => $customer->firstname, '{sponsored_lastname}' => $customer->lastname, '{discount_display}' => $discount_display, '{discount_name}' => $cartRule->code);
Mail::Send((int)$order->id_lang, 'referralprogram-congratulations', Mail::l('Congratulations!'), $data, $sponsor->email, $sponsor->firstname.' '.$sponsor->lastname, strval(Configuration::get('PS_SHOP_EMAIL')), strval(Configuration::get('PS_SHOP_NAME')), NULL, NULL, dirname(__FILE__).'/mails/');
Mail::Send((int)$order->id_lang, 'referralprogram-congratulations', Mail::l('Congratulations!', (int)$order->id_lang), $data, $sponsor->email, $sponsor->firstname.' '.$sponsor->lastname, strval(Configuration::get('PS_SHOP_EMAIL')), strval(Configuration::get('PS_SHOP_NAME')), NULL, NULL, dirname(__FILE__).'/mails/');
return true;
}
return false;
+1 -1
View File
@@ -66,7 +66,7 @@ if (Tools::getValue('action') == 'sendToMyFriend' AND
/* Email sending */
if (!Mail::Send((int)Context::getContext()->cookie->id_lang,
'send_to_a_friend',
Mail::l('A friend sent you a link to').' '.$product->name,
Mail::l('A friend sent you a link to', (int)Context::getContext()->cookie->id_lang).' '.$product->name,
$templateVars, $friendMail,
NULL,
(Context::getContext()->cookie->email ? Context::getContext()->cookie->email : NULL),