Skip to content

Commit

Permalink
CancelEmail should have its own template. (#801)
Browse files Browse the repository at this point in the history
fixes #798
  • Loading branch information
wernerkrauss committed Feb 20, 2024
1 parent facb6db commit d86e354
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Checkout/OrderEmailNotifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
42 changes: 42 additions & 0 deletions templates/SilverShop/Model/Order_CancelEmail.ss
Original file line number Diff line number Diff line change
@@ -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>

0 comments on commit d86e354

Please sign in to comment.