[-] 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
+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),