Mail language

This commit is contained in:
Michael RICOIS 2017-11-29 12:22:58 +01:00
parent 580621fc43
commit cc26558cae
4 changed files with 11 additions and 7 deletions

View File

@ -40,5 +40,6 @@ $_LANGMAIL['Message from \').$customer->lastname.\' '] = 'Mensaje de \').$custom
$_LANGMAIL[' $subject'] = '$subject';
$_LANGMAIL['A friend sent you a link to\').\' '] = 'Un amigo le envio un enlace a\').\'';
$_LANGMAIL['New voucher after refund'] = 'Nuevo código de reducción tras su devolución';
$_LANGMAIL['Your loyalty credits'] = 'Mi crédito de fidelidad';
?>

View File

@ -36,5 +36,6 @@ $_LANGMAIL['Congratulations!'] = 'Bravo !';
$_LANGMAIL['Referral Program'] = 'Programme de parrainage';
$_LANGMAIL['A friend sent you a link to'] = 'Un ami vous a envoyé un lien vers';
$_LANGMAIL['New voucher after refund'] = 'Nouveau bon de réduction après remboursement';
$_LANGMAIL['Your loyalty credits'] = 'Vos crédits fidélités';
?>

View File

@ -76,9 +76,9 @@ if ($nb > 0) {
$id_lang = $orderModel->id_lang;
$templateVars = array(
'firstname' => $customerModel->firstname,
'lastname' => $customerModel->lastname,
'commandenum' => $orderModel->id,
'{firstname}' => $customerModel->firstname,
'{lastname}' => $customerModel->lastname,
'{commandenum}' => $orderModel->id,
);
// Only Display values

View File

@ -3,8 +3,8 @@ class Mail extends MailCore
{
public static function Send($id_lang, $template, $subject, $templateVars, $to, $toName = NULL, $from = NULL, $fromName = NULL, $fileAttachment = NULL, $modeSMTP = NULL, $templatePath = _PS_MAIL_DIR_, $die = false) {
if(preg_match('/^contact\+(.*)@bebeboutik.com$/', $to)) {
return TRUE;
}
return TRUE;
}
if(!isset($templateVars['product_list'])) {
$templateVars['product_list'] = '';
@ -152,9 +152,11 @@ class Mail extends MailCore
/* Create mail and attach differents parts */
$message = new Swift_Message('['.Configuration::get('PS_SHOP_NAME').'] '. $subject);
global $cookie;
$id_lang = $cookie->id_lang;
// surchage multilangue
if ($id_lang === null) {
global $cookie;
$id_lang = $cookie->id_lang;
}
if ($id_lang) {
$templateVars['{shop_logo}'] = (file_exists(_PS_IMG_DIR_.'logo_mail_'.(int) $id_lang.'.jpg')) ? $message->attach(new Swift_Message_Image(new Swift_File(_PS_IMG_DIR_.'logo_mail_'.(int) $id_lang.'.jpg'))) : ((file_exists(_PS_IMG_DIR_.'logo.jpg')) ? $message->attach(new Swift_Message_Image(new Swift_File(_PS_IMG_DIR_.'logo.jpg'))) : '');
} else {