diff --git a/local/modules/OrderStatusNotify/EventListeners/OrderStatusListener.php b/local/modules/OrderStatusNotify/EventListeners/OrderStatusListener.php
index 309a9339..b3a836aa 100644
--- a/local/modules/OrderStatusNotify/EventListeners/OrderStatusListener.php
+++ b/local/modules/OrderStatusNotify/EventListeners/OrderStatusListener.php
@@ -9,7 +9,7 @@ use Thelia\Core\Event\Order\OrderEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Mailer\MailerFactory;
use Thelia\Model\OrderStatusI18nQuery;
-use Thelia\Model\OrderStatusQuery;
+use Thelia\Log\Tlog;
/**
* Class OrderStatusListener
@@ -37,7 +37,6 @@ class OrderStatusListener implements EventSubscriberInterface
$order = $event->getOrder();
$new_status_id = $event->getStatus();
- // Si la commande passe dans un statut pour lequel on doit avertir le client, alors on envoie un email au client en question.
$is_order_status_to_notify = OrderStatusNotificationQuery::create()->findOneByOrderStatusId($new_status_id);
if (null !== $is_order_status_to_notify) {
$new_statut_label = OrderStatusI18nQuery::create()
@@ -49,11 +48,12 @@ class OrderStatusListener implements EventSubscriberInterface
OrderStatusNotify::MESSAGE_NAME,
$order->getCustomer(),
[
+ 'order_id' => $order->getId(),
'order_ref' => $order->getRef(),
'new_status' => $new_statut_label,
]
);
- //Tlog::getInstance()->debug("Order status change sent to customer " . $order->getCustomer()->getEmail());
+ Tlog::getInstance()->debug("Order status change sent to customer " . $order->getCustomer()->getEmail());
}
}
}
diff --git a/local/modules/OrderStatusNotify/I18n/en_US.php b/local/modules/OrderStatusNotify/I18n/en_US.php
index 0b4fa142..beb6c42a 100644
--- a/local/modules/OrderStatusNotify/I18n/en_US.php
+++ b/local/modules/OrderStatusNotify/I18n/en_US.php
@@ -1,4 +1,12 @@
'The displayed english string',
+ 'Order status notification' => 'Order\'s status change notification',
+ 'Home' => 'Home',
+ 'Tools' => 'Tools',
+ 'To notify' => 'Notify to customer',
+ 'Status' => 'Order status',
+ 'Status list' => 'Order status list',
+ 'Purpose of feature' => 'Please select order status you want to notify the customer : an email will be sent when the order will get to this status.',
+ 'Change on your order %ref on %store_name' => 'Change on your order %ref on %store_name',
+ 'Hello, your order has just changed to' => 'Hello, your order has just changed to status : ',
);
diff --git a/local/modules/OrderStatusNotify/I18n/fr_FR.php b/local/modules/OrderStatusNotify/I18n/fr_FR.php
index 7e6d2016..074726e0 100644
--- a/local/modules/OrderStatusNotify/I18n/fr_FR.php
+++ b/local/modules/OrderStatusNotify/I18n/fr_FR.php
@@ -7,4 +7,6 @@ return [
'Status' => 'Statut de la commande',
'Status list' => 'Liste des statuts de commande',
'Purpose of feature' => 'Veuillez sélectionner les statuts de commande pour lesquels vous souhaitez notifier le client : dès que la commande passera dans ce statut, un email sera envoyé au client.',
+ 'Change on your order %ref on %store_name' => 'Evolution sur votre commande %ref sur le site %store_name',
+ 'Hello, your order has just changed to' => 'Bonjour, votre commande vient de passer à l\'état : ',
];
diff --git a/templates/email/default/order_status_changed.html b/templates/email/default/order_status_changed.html
new file mode 100644
index 00000000..4a304c6a
--- /dev/null
+++ b/templates/email/default/order_status_changed.html
@@ -0,0 +1,114 @@
+{extends file="email-layout.tpl"}
+
+{* Do not provide a "Open in browser" link *}
+{block name="browser"}{/block}
+{* No big image header *}
+{block name="image-header"}{/block}
+{* No logo header *}
+{block name="logo-header"}{/block}
+{* No pre-header *}
+{block name="pre-header"}{/block}
+
+{* Subject *}
+{block name="email-subject"}{intl d="orderstatusnotify" l="Change on your order %ref on %store_name" ref={$order_ref} store_name={config key="store_name"}}{/block}
+
+{* Title *}
+{block name="email-title"}{intl d="orderstatusnotify" l="Hello, your order has just changed to"}{$new_status}
{/block}
+
+{* Content *}
+{block name="email-content"}
+ {loop name="order.invoice" type="order" id=$order_id customer="*"}
+ {loop name="currency.order" type="currency" id=$CURRENCY}
+ {assign var="orderCurrencyIsoCode" value=$ISOCODE}
+ {/loop}
+
+ {loop type="customer" name="customer.invoice" id=$CUSTOMER current="0"}
+ {assign var="customerRef" value=$REF}
+ {/loop}
+
+ {hook name="email-html.order-notification.before-address" order=$order_id}
+
+
|
+ {intl l="Customer delivery address:"} + {ifhook rel="email-html.order-notification.delivery-address"} + {* delivery module can customize the delivery address *} + {hook name="email-html.order-notification.delivery-address" module={$DELIVERY_MODULE} order=$order_id} + {/ifhook} + {elsehook rel="email-html.order-notification.delivery-address"} + {format_address order_address=$DELIVERY_ADDRESS locale=$locale} + {/elsehook} + |
+
+ {intl l="Customer billing address:"} + {format_address order_address=$INVOICE_ADDRESS locale=$locale} + |
+
+ {intl l="Order Total:"} {format_money number=$TOTAL_TAXED_AMOUNT currency_id=$CURRENCY}
+ {intl l="Order Number:"} {$REF}
+ {intl l="Paid With:"} {loop name="payment-module" type="module" id=$PAYMENT_MODULE}{$TITLE}{/loop}
+ {intl l="Purchase Date:"} {format_date date=$CREATE_DATE output="datetime"}
+ {intl l="Delivery method:"} {loop name="delivery-module" type="module" id=$DELIVERY_MODULE}{$TITLE}{/loop}
+
| {intl l="What You Purchased"} | +{intl l="Price in"} {$orderCurrencyIsoCode} | +
|
+ {$TITLE} ({$REF})
+ {ifloop rel="combinations"} + {loop type="order_product_attribute_combination" name="combinations" order_product=$ID} + * {$ATTRIBUTE_TITLE}: {$ATTRIBUTE_AVAILABILITY_TITLE} + {/loop} + {/ifloop} + |
+ + {$QUANTITY} x {format_money number=$realTaxedPrice currency_id=$CURRENCY} + | +
| {intl l="Total"} | +{format_money number={$TOTAL_TAXED_AMOUNT - $POSTAGE} currency_id=$CURRENCY} | +
| {intl l="Shipping:"} | +{format_money number=$POSTAGE currency_id=$CURRENCY} | +
| {intl l="Order Total"} | +{format_money number=$TOTAL_TAXED_AMOUNT currency_id=$CURRENCY} | +