From 1c32791fa042f383a7e29a1f3ee82c1927dc7c1d Mon Sep 17 00:00:00 2001 From: lLefevre Date: Mon, 5 Dec 2011 17:22:47 +0000 Subject: [PATCH] [-] BO & FO & MO : #PSCFI-4237 : adding id_lang in method l() of class Mail() --- classes/Customer.php | 2 +- classes/Logger.php | 2 +- classes/PaymentModule.php | 2 +- controllers/admin/AdminCustomerThreadsController.php | 6 +++--- controllers/admin/AdminLoginController.php | 2 +- controllers/admin/AdminOrdersController.php | 10 +++++----- modules/blocknewsletter/blocknewsletter.php | 6 +++--- modules/blockwishlist/mywishlist.php | 2 +- modules/blockwishlist/sendwishlist.php | 2 +- modules/followup/followup.php | 8 ++++---- modules/mailalerts/mailalerts.php | 8 ++++---- modules/paypal/express/submit.php | 2 +- modules/paypal/paypal.php | 2 +- modules/referralprogram/referralprogram-program.php | 4 ++-- modules/referralprogram/referralprogram.php | 4 ++-- modules/sendtoafriend/sendtoafriend_ajax.php | 2 +- 16 files changed, 32 insertions(+), 32 deletions(-) diff --git a/classes/Customer.php b/classes/Customer.php index 94c497d7c..01b4e3e0c 100644 --- a/classes/Customer.php +++ b/classes/Customer.php @@ -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 diff --git a/classes/Logger.php b/classes/Logger.php index e082d7bfc..e95588d18 100644 --- a/classes/Logger.php +++ b/classes/Logger.php @@ -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') ); diff --git a/classes/PaymentModule.php b/classes/PaymentModule.php index 3dc537858..937775371 100644 --- a/classes/PaymentModule.php +++ b/classes/PaymentModule.php @@ -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); } } diff --git a/controllers/admin/AdminCustomerThreadsController.php b/controllers/admin/AdminCustomerThreadsController.php index 9cd3f15d4..633aec9af 100644 --- a/controllers/admin/AdminCustomerThreadsController.php +++ b/controllers/admin/AdminCustomerThreadsController.php @@ -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)) { diff --git a/controllers/admin/AdminLoginController.php b/controllers/admin/AdminLoginController.php index 11589533a..05541c43d 100755 --- a/controllers/admin/AdminLoginController.php +++ b/controllers/admin/AdminLoginController.php @@ -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.'))))); diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 233ed6f98..e6bb79633 100755 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -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.')))); } } diff --git a/modules/blocknewsletter/blocknewsletter.php b/modules/blocknewsletter/blocknewsletter.php index 4150ee290..e3dd7dffd 100644 --- a/modules/blocknewsletter/blocknewsletter.php +++ b/modules/blocknewsletter/blocknewsletter.php @@ -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) diff --git a/modules/blockwishlist/mywishlist.php b/modules/blockwishlist/mywishlist.php index 7ab3bf6b5..bbf118078 100644 --- a/modules/blockwishlist/mywishlist.php +++ b/modules/blockwishlist/mywishlist.php @@ -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), diff --git a/modules/blockwishlist/sendwishlist.php b/modules/blockwishlist/sendwishlist.php index 1ef55a48e..bea3010f8 100644 --- a/modules/blockwishlist/sendwishlist.php +++ b/modules/blockwishlist/sendwishlist.php @@ -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, diff --git a/modules/followup/followup.php b/modules/followup/followup.php index 8a97eefa8..37b663ee5 100644 --- a/modules/followup/followup.php +++ b/modules/followup/followup.php @@ -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'])); } } diff --git a/modules/mailalerts/mailalerts.php b/modules/mailalerts/mailalerts.php index c0a1b6cd7..7aa4b5857 100644 --- a/modules/mailalerts/mailalerts.php +++ b/modules/mailalerts/mailalerts.php @@ -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); diff --git a/modules/paypal/express/submit.php b/modules/paypal/express/submit.php index 5d1c1b2f0..267efd5a4 100644 --- a/modules/paypal/express/submit.php +++ b/modules/paypal/express/submit.php @@ -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); diff --git a/modules/paypal/paypal.php b/modules/paypal/paypal.php index 1d1e2ed35..0cdbd0dfe 100644 --- a/modules/paypal/paypal.php +++ b/modules/paypal/paypal.php @@ -648,7 +648,7 @@ class PayPal extends PaymentModule $this->context->smarty->assign('logs', $log); $data = array('{logs}' => implode('
', $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; diff --git a/modules/referralprogram/referralprogram-program.php b/modules/referralprogram/referralprogram-program.php index e10a25b02..deeeeb09b 100644 --- a/modules/referralprogram/referralprogram-program.php +++ b/modules/referralprogram/referralprogram-program.php @@ -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++; } diff --git a/modules/referralprogram/referralprogram.php b/modules/referralprogram/referralprogram.php index 8b652c01e..bf1cdfdc5 100644 --- a/modules/referralprogram/referralprogram.php +++ b/modules/referralprogram/referralprogram.php @@ -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; diff --git a/modules/sendtoafriend/sendtoafriend_ajax.php b/modules/sendtoafriend/sendtoafriend_ajax.php index d8f2b8a61..a4db67d9d 100644 --- a/modules/sendtoafriend/sendtoafriend_ajax.php +++ b/modules/sendtoafriend/sendtoafriend_ajax.php @@ -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),