From d86e354a2cf985dfd9ae2d21098c29622dc5d943 Mon Sep 17 00:00:00 2001 From: wernerkrauss Date: Fri, 27 Oct 2023 17:47:12 +0200 Subject: [PATCH] CancelEmail should have its own template. (#801) fixes #798 --- src/Checkout/OrderEmailNotifier.php | 7 +++- .../SilverShop/Model/Order_CancelEmail.ss | 42 +++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 templates/SilverShop/Model/Order_CancelEmail.ss diff --git a/src/Checkout/OrderEmailNotifier.php b/src/Checkout/OrderEmailNotifier.php index 69deb6d90..ca95990ee 100644 --- a/src/Checkout/OrderEmailNotifier.php +++ b/src/Checkout/OrderEmailNotifier.php @@ -232,7 +232,12 @@ public function sendCancelNotification() )) ->setFrom(Email::config()->admin_email) ->setTo(Email::config()->admin_email) - ->setBody($this->order->renderWith(Order::class)); + ->setHTMLTemplate('SilverShop/Model/Order_CancelEmail') + ->setData( + [ + 'Order' => $this->order, + ] + ); $this->extend('updateCancelNotificationEmail', $email); diff --git a/templates/SilverShop/Model/Order_CancelEmail.ss b/templates/SilverShop/Model/Order_CancelEmail.ss new file mode 100644 index 000000000..db9c5190f --- /dev/null +++ b/templates/SilverShop/Model/Order_CancelEmail.ss @@ -0,0 +1,42 @@ + + + + + <%t SilverShop\ShopEmail.CancelNotificationTitle "Order cancelled" %> + <% include SilverShop\Includes\OrderReceiptStyle %> + + + + + + +
+ + + + + + + + <% if $Order %> + + + + + <% loop $Order %> + + + + <% end_loop %> + <% end_if %> + +
+

$Subject

+
+ <%t SilverShop\ShopEmail.OrderCancelled 'Order #{OrderNo} was cancelled"' OrderNo=$Order.Reference %> +
+ <% include SilverShop\Model\Order %> +
+
+ +