PluginProbe
VikBooking Hotel Booking Engine & PMS / 1.8.16
VikBooking Hotel Booking Engine & PMS v1.8.16
1.8.16 1.8.15 1.8.14 1.8.13 1.8.12 1.8.11 1.8.10 1.8.9 1.8.6 1.8.7 1.8.8 trunk 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 All 37 releases
← All changes | admin/controllers/mail.php +7 -0 1.7.2 → 1.8.16 View file →
@@ -48,8 +48,9 @@
48 48 ->where($dbo->qn('status') . ' = ' . $dbo->q('confirmed'))
49 49 ->where($dbo->qn('closure') . ' = 0');
50 50
51 51 if (!empty($bid)) {
52 + $q->clear('where');
52 53 $q->where($dbo->qn('id') . ' = ' . $bid);
53 54 }
54 55
55 56 $q->order($dbo->qn('id') . ' DESC');
@@ -56,8 +57,9 @@
56 57
57 58 $dbo->setQuery($q, 0, 1);
58 59 $booking = $dbo->loadAssoc();
59 60
61 + $booking_rooms = [];
60 62 if ($booking) {
61 63 $booking_rooms = VikBooking::loadOrdersRoomsData($booking['id']);
62 64 // inject properties for parsing the conditional text rules later
63 65 VikBooking::getConditionalRulesInstance()->set(['booking', 'rooms'], [$booking, $booking_rooms]);
@@ -75,8 +77,13 @@
75 77 ]);
76 78
77 79 // prepare the final email content
78 80 $mail_content = VBOFactory::getPlatform()->getMailer()->prepare($mail_data);
81 +
82 + if ($booking) {
83 + // apply a common replacement method for the special tags
84 + $mail_content = VBOMailParser::replaceSpecialTags($mail_content, $booking, $booking_rooms);
85 + }
79 86
80 87 // send JSON response to output
81 88 VBOHttpDocument::getInstance($app)->json([$mail_content]);
82 89 }