[-] BO : #PSCFV-3000 - Send an email on changing an order from the BO

This commit is contained in:
mDeflotte
2012-07-12 12:05:19 +00:00
parent 1a41638de5
commit 4c5cce43e1
14 changed files with 345 additions and 1 deletions
+2 -1
View File
@@ -295,7 +295,8 @@ class LanguageCore extends ObjectModel
'shipped.html', 'shipped.txt',
'test.html', 'test.txt',
'voucher.html', 'voucher.txt',
'voucher_new.html', 'voucher_new.txt'
'voucher_new.html', 'voucher_new.txt',
'order_changed.html', 'order_changed.txt'
);
$number = -1;
+14
View File
@@ -975,6 +975,20 @@ class OrderCore extends ObjectModel
}
return $return;
}
/**
* Get order customer
*
* @return Customer $customer
*/
public function getCustomer()
{
static $customer = null;
if (is_null($customer))
$customer = new Customer((int)$this->id_customer);
return $customer;
}
/**
* Get customer orders number
@@ -1715,6 +1715,8 @@ class AdminOrdersControllerCore extends AdminController
'link' => Context::getContext()->link,
'current_index' => self::$currentIndex
));
$this->sendChangedNotification($order);
die(Tools::jsonEncode(array(
'result' => true,
@@ -1727,6 +1729,27 @@ class AdminOrdersControllerCore extends AdminController
'discount_form_html' => $this->createTemplate('_discount_form.tpl')->fetch()
)));
}
public function sendChangedNotification(Order $order = null)
{
if (is_null($order))
$order = new Order(Tools::getValue('id_order'));
$data = array(
'{lastname}' => $order->getCustomer()->lastname,
'{firstname}' => $order->getCustomer()->firstname,
'{id_order}' => (int)$order->id,
'{order_name}' => $order->getUniqReference()
);
Mail::Send(
(int)$order->id_lang,
'order_changed',
Mail::l('Your order has been changed', $order->id_lang),
$data,
$order->getCustomer()->email,
$order->getCustomer()->firstname.' '.$order->getCustomer()->lastname);
}
public function ajaxProcessLoadProductInformation()
{
@@ -1902,6 +1925,8 @@ class AdminOrdersControllerCore extends AdminController
$view = $this->createTemplate('_customized_data.tpl')->fetch();
else
$view = $this->createTemplate('_product_line.tpl')->fetch();
$this->sendChangedNotification($order);
die(Tools::jsonEncode(array(
'result' => $res,
@@ -1973,6 +1998,8 @@ class AdminOrdersControllerCore extends AdminController
'link' => Context::getContext()->link,
'current_index' => self::$currentIndex
));
$this->sendChangedNotification($order);
die(Tools::jsonEncode(array(
'result' => $res,
+49
View File
@@ -0,0 +1,49 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Message from {shop_name}</title>
</head>
<body>
<table style="font-family: Verdana,sans-serif; font-size: 11px; color: #374953; width: 550px;">
<tbody>
<tr>
<td align="left"><a title="{shop_name}" href="{shop_url}"><img style="border: none;" src="{shop_logo}" alt="{shop_name}" /></a></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td align="left">Hi <strong style="color: #db3484;">{firstname} {lastname}</strong>,</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td style="background-color: #db3484; color: #fff; font-size: 12px; font-weight: bold; padding: 0.5em 1em;" align="left">Your order with the reference {order_name} - Order changed</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td align="left"><strong>Your order with the reference {order_name} from {shop_name} has been changed by the merchant.</strong></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td align="left">You can review your order and download your invoice from the <a style="color: #db3484; font-weight: bold; text-decoration: none;" href="{shop_url}?controller=history">"Order history"</a> section of your customer account by clicking <a style="color: #db3484; font-weight: bold; text-decoration: none;" href="{shop_url}?controller=my-account">"My account"</a> on our shop.<br /><br /></td>
</tr>
<tr>
<td align="left">If you have guest account, you can follow your order via the <a style="color: #db3484; font-weight: bold; text-decoration: none;" href="{shop_url}?controller=guest-tracking">"Guest Tracking"</a> section on our shop.</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td style="font-size: 10px; border-top: 1px solid #D9DADE;" align="center"><a style="color: #db3484; font-weight: bold; text-decoration: none;" href="{shop_url}">{shop_name}</a> powered by <a style="text-decoration: none; color: #374953;" href="http://www.prestashop.com/">PrestaShop&trade;</a></td>
</tr>
</tbody>
</table>
</body>
</html>
+11
View File
@@ -0,0 +1,11 @@
Hi {firstname} {lastname},
Your order with the reference {order_name} from {shop_name} has been changed by the merchant.
You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.
If you have guest account, you can follow your order using this link: {shop_url}?controller=guest-tracking
{shop_name} - {shop_url}
{shop_url} powered by PrestaShop™
+49
View File
@@ -0,0 +1,49 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Message from {shop_name}</title>
</head>
<body>
<table style="font-family: Verdana,sans-serif; font-size: 11px; color: #374953; width: 550px;">
<tbody>
<tr>
<td align="left"><a title="{shop_name}" href="{shop_url}"><img style="border: none;" src="{shop_logo}" alt="{shop_name}" /></a></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td align="left">Hi <strong style="color: #db3484;">{firstname} {lastname}</strong>,</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td style="background-color: #db3484; color: #fff; font-size: 12px; font-weight: bold; padding: 0.5em 1em;" align="left">Your order with the reference {order_name} - Order changed</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td align="left"><strong>Your order with the reference {order_name} from {shop_name} has been changed by the merchant.</strong></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td align="left">You can review your order and download your invoice from the <a style="color: #db3484; font-weight: bold; text-decoration: none;" href="{shop_url}?controller=history">"Order history"</a> section of your customer account by clicking <a style="color: #db3484; font-weight: bold; text-decoration: none;" href="{shop_url}?controller=my-account">"My account"</a> on our shop.<br /><br /></td>
</tr>
<tr>
<td align="left">If you have guest account, you can follow your order via the <a style="color: #db3484; font-weight: bold; text-decoration: none;" href="{shop_url}?controller=guest-tracking">"Guest Tracking"</a> section on our shop.</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td style="font-size: 10px; border-top: 1px solid #D9DADE;" align="center"><a style="color: #db3484; font-weight: bold; text-decoration: none;" href="{shop_url}">{shop_name}</a> powered by <a style="text-decoration: none; color: #374953;" href="http://www.prestashop.com/">PrestaShop&trade;</a></td>
</tr>
</tbody>
</table>
</body>
</html>
+11
View File
@@ -0,0 +1,11 @@
Hi {firstname} {lastname},
Your order with the reference {order_name} from {shop_name} has been changed by the merchant.
You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.
If you have guest account, you can follow your order using this link: {shop_url}?controller=guest-tracking
{shop_name} - {shop_url}
{shop_url} powered by PrestaShop™
+49
View File
@@ -0,0 +1,49 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Message from {shop_name}</title>
</head>
<body>
<table style="font-family: Verdana,sans-serif; font-size: 11px; color: #374953; width: 550px;">
<tbody>
<tr>
<td align="left"><a title="{shop_name}" href="{shop_url}"><img style="border: none;" src="{shop_logo}" alt="{shop_name}" /></a></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td align="left">Hi <strong style="color: #db3484;">{firstname} {lastname}</strong>,</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td style="background-color: #db3484; color: #fff; font-size: 12px; font-weight: bold; padding: 0.5em 1em;" align="left">Your order with the reference {order_name} - Order changed</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td align="left"><strong>Your order with the reference {order_name} from {shop_name} has been changed by the merchant.</strong></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td align="left">You can review your order and download your invoice from the <a style="color: #db3484; font-weight: bold; text-decoration: none;" href="{shop_url}?controller=history">"Order history"</a> section of your customer account by clicking <a style="color: #db3484; font-weight: bold; text-decoration: none;" href="{shop_url}?controller=my-account">"My account"</a> on our shop.<br /><br /></td>
</tr>
<tr>
<td align="left">If you have guest account, you can follow your order via the <a style="color: #db3484; font-weight: bold; text-decoration: none;" href="{shop_url}?controller=guest-tracking">"Guest Tracking"</a> section on our shop.</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td style="font-size: 10px; border-top: 1px solid #D9DADE;" align="center"><a style="color: #db3484; font-weight: bold; text-decoration: none;" href="{shop_url}">{shop_name}</a> powered by <a style="text-decoration: none; color: #374953;" href="http://www.prestashop.com/">PrestaShop&trade;</a></td>
</tr>
</tbody>
</table>
</body>
</html>
+11
View File
@@ -0,0 +1,11 @@
Hi {firstname} {lastname},
Your order with the reference {order_name} from {shop_name} has been changed by the merchant.
You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.
If you have guest account, you can follow your order using this link: {shop_url}?controller=guest-tracking
{shop_name} - {shop_url}
{shop_url} powered by PrestaShop™
+1
View File
@@ -12,6 +12,7 @@ $_LANGMAIL['Fwd: Customer message'] = 'TR: Message d\'un client';
$_LANGMAIL['Your guest account has been transformed to customer account'] = 'Votre compte invité a été transformé en compte client';
$_LANGMAIL['Package in transit'] = 'Livraison en cours';
$_LANGMAIL['Log: You have a new alert from your shop'] = 'Log : Vous avez un nouveau message d\'alerte dans votre boutique';
$_LANGMAIL['Your order has been changed'] = 'Votre commande a été modifiée';
$_LANGMAIL['Order confirmation'] = 'Confirmation de commande';
$_LANGMAIL['Message from a customer'] = 'Message d\'un client';
$_LANGMAIL['New message regarding your order'] = 'Nouveau message concernant votre commande';
+49
View File
@@ -0,0 +1,49 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Message de {shop_name}</title>
</head>
<body>
<table style="font-family: Verdana,sans-serif; font-size: 11px; color: #374953; width: 550px;">
<tbody>
<tr>
<td align="left"><a title="{shop_name}" href="{shop_url}"><img style="border: none;" src="{shop_logo}" alt="{shop_name}" /></a></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td align="left">Bonjour <strong style="color: #db3484;">{firstname} {lastname}</strong>,</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td style="background-color: #db3484; color: #fff; font-size: 12px; font-weight: bold; padding: 0.5em 1em;" align="left">Historique de votre commande ayant pour r&eacute;f&eacute;rence {order_name}</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td align="left"><strong>Votre commande a &eacute;t&eacute; a &eacute;t&eacute; modifi&eacute;e par le marchand.</strong></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td align="left">Vous pouvez consulter votre commande et t&eacute;l&eacute;charger votre facture dans <a style="color: #db3484; font-weight: bold; text-decoration: none;" href="{shop_url}?controller=history">"Historique des commandes"</a> de la rubrique <a style="color: #db3484; font-weight: bold; text-decoration: none;" href="{shop_url}?controller=my-account">"Mon compte"</a> sur notre site.</td>
</tr>
<tr>
<td align="left">Si vous avez un compte invit&eacute;, vous pouvez consulter votre commande dans la section <a style="color: #db3484; font-weight: bold; text-decoration: none;" href="{shop_url}?controller=guest-tracking">"Suivi invit&eacute;"</a> de notre site.</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td style="font-size: 10px; border-top: 1px solid #D9DADE;" align="center"><a style="color: #db3484; font-weight: bold; text-decoration: none;" href="{shop_url}">{shop_name}</a> r&eacute;alis&eacute; avec <a style="text-decoration: none; color: #374953;" href="http://www.prestashop.com/">PrestaShop&trade;</a></td>
</tr>
</tbody>
</table>
</body>
</html>
+12
View File
@@ -0,0 +1,12 @@
Bonjour {firstname} {lastname},
Votre commande ayant pour référence {order_name} a été modifiée par le marchand.
Vous pouvez à tout moment consulter votre commande dans "Historique des commandes" de la rubrique "Mon compte" sur notre site {shop_name}.
Si vous avez un compte invité, vous pouvez consulter votre commande à cette adresse : {shop_url}?controller=guest-tracking
{shop_name} - {shop_url}
{shop_url} réalisé avec PrestaShop™
+49
View File
@@ -0,0 +1,49 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Message from {shop_name}</title>
</head>
<body>
<table style="font-family: Verdana,sans-serif; font-size: 11px; color: #374953; width: 550px;">
<tbody>
<tr>
<td align="left"><a title="{shop_name}" href="{shop_url}"><img style="border: none;" src="{shop_logo}" alt="{shop_name}" /></a></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td align="left">Hi <strong style="color: #db3484;">{firstname} {lastname}</strong>,</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td style="background-color: #db3484; color: #fff; font-size: 12px; font-weight: bold; padding: 0.5em 1em;" align="left">Your order with the reference {order_name} - Order changed</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td align="left"><strong>Your order with the reference {order_name} from {shop_name} has been changed by the merchant.</strong></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td align="left">You can review your order and download your invoice from the <a style="color: #db3484; font-weight: bold; text-decoration: none;" href="{shop_url}?controller=history">"Order history"</a> section of your customer account by clicking <a style="color: #db3484; font-weight: bold; text-decoration: none;" href="{shop_url}?controller=my-account">"My account"</a> on our shop.<br /><br /></td>
</tr>
<tr>
<td align="left">If you have guest account, you can follow your order via the <a style="color: #db3484; font-weight: bold; text-decoration: none;" href="{shop_url}?controller=guest-tracking">"Guest Tracking"</a> section on our shop.</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td style="font-size: 10px; border-top: 1px solid #D9DADE;" align="center"><a style="color: #db3484; font-weight: bold; text-decoration: none;" href="{shop_url}">{shop_name}</a> powered by <a style="text-decoration: none; color: #374953;" href="http://www.prestashop.com/">PrestaShop&trade;</a></td>
</tr>
</tbody>
</table>
</body>
</html>
+11
View File
@@ -0,0 +1,11 @@
Hi {firstname} {lastname},
Your order with the reference {order_name} from {shop_name} has been changed by the merchant.
You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.
If you have guest account, you can follow your order using this link: {shop_url}?controller=guest-tracking
{shop_name} - {shop_url}
{shop_url} powered by PrestaShop™