Skip to content

Commit

Permalink
Merge pull request #862 from shreesh-webkul/gli-1615
Browse files Browse the repository at this point in the history
Update: Order cancel status mail content
  • Loading branch information
rohit053 authored Mar 15, 2024
2 parents e163a5c + daa8f39 commit 07e50d2
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 3 deletions.
18 changes: 18 additions & 0 deletions classes/order/OrderHistory.php
Original file line number Diff line number Diff line change
Expand Up @@ -440,11 +440,29 @@ public function sendEmail($order, $template_vars = false)
'{firstname}' => $result['firstname'],
'{id_order}' => (int)$this->id_order,
'{order_name}' => $order->getUniqReference(),
'{total_paid_real}' => Tools::displayPrice($order->total_paid_real, (int)$order->id_currency),
'{is_advance_payment}' => $order->is_advance_payment,
'{advance_paid_amount}' => Tools::displayPrice($order->advance_paid_amount, (int)$order->id_currency),
'{extra_mail_content_html}' => '',
'{extra_mail_content_txt}' => '',
'{payment_method}' => '',
);

if ($idHotel = HotelBookingDetail::getIdHotelByIdOrder($order->id)) {
$objHotelBranchInformation = new HotelBranchInformation($idHotel, $order->id_lang);
$fields = array_merge(
$objHotelBranchInformation->getFields(),
$objHotelBranchInformation->getFieldsLang()[$order->id_lang],
$objHotelBranchInformation->getAddress($idHotel, $order->id_lang)
);
foreach ($fields as $key => $value) {
$data['{hotel_'.$key.'}'] = $value;
}
$objHotelBookingDetail = new HotelBookingDetail();
$hotelBookingDetail = $objHotelBookingDetail->getBookingDataByOrderId($order->id);
$data['{num_rooms}'] = count($hotelBookingDetail);
}

if ($result['module_name']) {
if (Validate::isLoadedObject($module = Module::getInstanceByName($result['module_name']))) {
$data['{payment_method}'] = $module->displayName;
Expand Down
42 changes: 39 additions & 3 deletions mails/en/order_canceled.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,45 @@
<td style="padding:7px 0">
<font size="2" face="Open-sans, sans-serif" color="#555454">
<p data-html-only="1" style="border-bottom:1px solid #D6D4D4;margin:3px 0 7px;text-transform:uppercase;font-weight:500;font-size:18px;padding-bottom:10px">
Order {order_name}&nbsp;-&nbsp;Order canceled </p>
<span style="color:#777">
Your order with the reference <span style="color:#333"><strong>{order_name}</strong></span> from <span style="color:#333"><strong>{shop_name}</strong></span> has been canceled. </span>
Order canceled&nbsp;-&nbsp;<a href="{history_url}" style="color:#337ff1">{order_name}</a>
</p>
<span style="color:#777">Your order with the reference <span style="color:#333"><strong>{order_name}</strong></span> from <span style="color:#333"><strong>{shop_name}</strong></span> has been canceled.</span>
</font>
</td>
<td width="10" style="padding:7px 0">&nbsp;</td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="space_footer" style="padding:0!important">&nbsp;</td>
</tr>
<tr>
<td class="box" style="border:1px solid #D6D4D4;background-color:#f8f8f8;padding:7px 0">
<table class="table" style="width:100%">
<tr>
<td width="10" style="padding:7px 0">&nbsp;</td>
<td style="padding:7px 0">
<font size="2" face="Open-sans, sans-serif" color="#555454">
<p data-html-only="1" style="margin:3px 0 0px;font-weight:500;font-size:18px;padding-bottom: 10px;">
Here are your order details:
</p>
<p style="margin:3px 0 0px;">
<span style="color:#333"><strong>Order reference:</strong></span> {order_name}<br />
<span style="color:#333"><strong>Order total:</strong></span> {total_paid}<br />
<span style="color:#333"><strong>Total Rooms:</strong></span> {num_rooms}<br />
</p>
</font>
<br/>
<font size="2" face="Open-sans, sans-serif" color="#555454">
<p data-html-only="1" style="margin:3px 0 0px;font-weight:500;font-size:18px;padding-bottom: 10px;">
Hotel details:
</p>
<p style="margin:3px 0 0px;">
<span style="color:#333"><strong>Hotel Name:</strong></span> {hotel_hotel_name}<br />
<span style="color:#333"><strong>Hotel Phone:</strong></span> {hotel_phone}<br />
<span style="color:#333"><strong>Hotel Email:</strong></span> {hotel_email}<br />
</p>
</font>
</td>
<td width="10" style="padding:7px 0">&nbsp;</td>
Expand Down
10 changes: 10 additions & 0 deletions mails/en/order_canceled.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ Hi {firstname} {lastname},
Your order with the reference {order_name} from {shop_name} has
been canceled.

Here are your order details:
Order reference: {order_name}
Order total: {total_paid}
Total Rooms: {num_rooms}

Hotel details:
Hotel Name: {hotel_hotel_name}
Hotel Phone: {hotel_phone}
Hotel Email: {hotel_email}

{extra_mail_content_txt}

You can review your order and download your invoice from the
Expand Down

0 comments on commit 07e50d2

Please sign in to comment.