From 97eb93df686592082c30ba67175ce62ba6b38f2f Mon Sep 17 00:00:00 2001 From: wernerkrauss <werner.krauss@netwerkstatt.at> 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 2dc204dee..e22ee3585 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 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> + <title><%t SilverShop\ShopEmail.CancelNotificationTitle "Order cancelled" %></title> + <% include SilverShop\Includes\OrderReceiptStyle %> +</head> +<body> +<table id="container" cellpadding="0" cellspacing="0" border="0"> + <tr> + <td> + <table id="Content" cellspacing="0" cellpadding="0" summary="Email Information"> + <thead> + <tr> + <th scope="col" colspan="2"> + <h1 class="title">$Subject</h1> + </th> + </tr> + </thead> + <tbody> + <% if $Order %> + <tr> + <td class="" valign="top"> + <%t SilverShop\ShopEmail.OrderCancelled 'Order #{OrderNo} was cancelled"' OrderNo=$Order.Reference %> + </td> + </tr> + + <% loop $Order %> + <tr> + <td> + <% include SilverShop\Model\Order %> + </td> + </tr> + <% end_loop %> + <% end_if %> + </tbody> + </table> + </td> + </tr> +</table> +</body> +</html>