PluginProbe ʕ •ᴥ•ʔ
VikAppointments Services Booking Calendar / 1.2.21
VikAppointments Services Booking Calendar v1.2.21
1.2.21 1.2.20 trunk 1.2.17 1.2.18 1.2.19
vikappointments / site / helpers / mail_tmpls / customer_email_tmpl.php
vikappointments / site / helpers / mail_tmpls Last commit date
admin_email_tmpl.php 6 days ago cancellation_email_tmpl.php 6 days ago customer_email_tmpl.php 6 days ago employee_email_tmpl.php 6 days ago index.html 6 days ago packages_email_tmpl.php 6 days ago stock_email_tmpl.php 6 days ago waitlist_email_tmpl.php 6 days ago
customer_email_tmpl.php
582 lines
1 <?php
2 /**
3 * @package VikAppointments
4 * @subpackage core
5 * @author E4J s.r.l.
6 * @copyright Copyright (C) 2021 E4J s.r.l. All Rights Reserved.
7 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
8 * @link https://vikwp.com
9 */
10
11 // No direct access
12 defined('ABSPATH') or die('No script kiddies please!');
13
14 /**
15 * VikAppointments - Customer E-Mail Template.
16 *
17 * @var object $order It is possible to use this variable to
18 * access the details of the order.
19 *
20 * @see the bottom of the page to check the available TAGS to use.
21 */
22
23 $config = VAPFactory::getConfig();
24 $currency = VAPFactory::getCurrency();
25
26 ?>
27
28 <style>
29 @media print {
30 .no-printable {
31 display: none;
32 }
33 }
34 </style>
35
36 <div style="background:#fff; color: #666; width: 100%; table-layout: fixed;">
37 <div style="max-width: 600px; margin:0 auto;">
38
39 <!--[if (gte mso 9)|(IE)]>
40 <table width="800" align="center">
41 <tr>
42 <td>
43 <![endif]-->
44
45 <table align="center" style="margin: 0 auto; width: 100%; max-width: 600px; border-spacing: 0; font-family: sans-serif;">
46
47 <!-- TOP BOX [company logo and name] -->
48
49 <tr>
50 <td style="padding: 0;">
51 <p style="display: inline-block; float: left; max-width: 150px;">{logo}</p>
52 <h3 style="display: inline-block; float: right;">{company_name}</h3>
53 </td>
54 </tr>
55
56 <!-- CUSTOM POSITION TOP -->
57
58 <tr>
59 <td style="padding: 0;">
60 {custom_position_top}
61 </td>
62 </tr>
63
64 <!-- ORDER NUMBER BOX -->
65
66 <tr>
67 <td style="padding: 0; text-align: center;">
68 <table width="100%" style="border-spacing: 0; margin: 10px auto 0; font-size: 14px; background: #f2f3f7;">
69 <tr>
70 <td style="padding: 20px 10px; line-height: 1.4em; text-align: left;">
71 <div style="float:left; display:inline-block;">
72 <?php echo JText::translate('VAPORDERNUMBER'); ?>: {order_number}
73 </div>
74 </td>
75 </tr>
76 </table>
77 </td>
78 </tr>
79
80 <!-- ORDER KEY AND STATUS -->
81
82 <tr>
83 <td style="padding: 0; text-align: center;">
84 <table width="100%" style="border-spacing: 0; margin: 10px auto 0; font-size: 14px; background: #f2f3f7;">
85 <tr>
86 <td style="padding: 20px 10px; line-height: 1.4em; text-align: left;">
87 <div style="float:left; display:inline-block;">
88 {order_key}
89 </div>
90 <div style="float:right; display:inline-block;">
91 {order_status}
92 </div>
93 </td>
94 </tr>
95 </table>
96 </td>
97 </tr>
98
99 <!-- TOTAL COST AND PAYMENT GATEWAY -->
100
101 <?php
102 if ($order->totals->gross > 0)
103 {
104 ?>
105 <tr>
106 <td style="padding: 0; text-align: center;">
107 <table width="100%" style="border-spacing: 0; margin: 10px auto 0; font-size: 14px; background: #f2f3f7;">
108 <tr>
109 <td style="padding: 20px 10px; line-height: 1.4em; text-align: left;">
110 <div style="float:left; display:inline-block;">
111 <?php
112 if ($order->payment)
113 {
114 // show payment name
115 ?>
116 {order_payment}
117 <?php
118 }
119 else
120 {
121 // show grand total label
122 echo JText::translate('VAPORDERDEPOSIT');
123 }
124 ?>
125 </div>
126
127 <div style="float:right; display:inline-block;">{order_total_cost}</div>
128 </td>
129 </tr>
130 </table>
131 </td>
132 </tr>
133 <?php
134 }
135 ?>
136
137 <!-- COUPON CODE -->
138
139 <?php
140 if ($order->coupon)
141 {
142 ?>
143 <tr>
144 <td style="padding: 0; text-align: center;">
145 <table width="100%" style="border-spacing: 0; margin: 10px auto 0; font-size: 14px; background: #f2f3f7;">
146 <tr>
147 <td style="padding: 20px 10px; line-height: 1.4em; text-align: left;">
148 <div style="float:left; display:inline-block;">
149 <?php echo JText::translate('VAPORDERCOUPON'); ?>
150 </div>
151 <div style="float:right; display:inline-block;">
152 {order_coupon_code}
153 </div>
154 </td>
155 </tr>
156 </table>
157 </td>
158 </tr>
159 <?php
160 }
161 ?>
162
163 <!-- CUSTOM POSITION MIDDLE -->
164
165 <tr>
166 <td style="padding: 0; text-align: center;">
167 <table width="100%" style="border-spacing: 0; margin: 0 auto">
168 <tr>
169 <td>
170 {custom_position_middle}
171 </td>
172 </tr>
173 </table>
174 </td>
175 </tr>
176
177 <!-- APPOINTMENTS BOX -->
178
179 <?php
180 foreach ($order->appointments as $row)
181 {
182 ?>
183 <tr>
184 <td style="padding: 0; text-align: center;">
185 <table width="100%" style="border-spacing: 0; margin: 10px auto 0; padding: 0; font-size: 14px; background: #f2f3f7;">
186
187 <tr>
188 <td style="padding: 0; line-height: 1.4em; text-align: left;">
189 <div>
190
191 <div style="padding: 10px;background-color: #f8f8f8;">
192 <?php
193 echo $row->service->name;
194
195 /**
196 * Display number of participants if higher than 1.
197 *
198 * @since 1.6.3
199 */
200 if ($row->people > 1)
201 {
202 echo ' x' . $row->people . ' ';
203 }
204
205 /**
206 * Display employee name only if it was chosen by
207 * the customer.
208 *
209 * @since 1.6.3
210 */
211 if ($row->viewEmp)
212 {
213 echo ' - ' . $row->employee->name;
214 }
215 ?>
216
217 <br />
218
219 <?php
220 // display check-in
221 echo $row->customerCheckin->lc;
222
223 if ($config->getBool('multitimezone'))
224 {
225 // in case of multi-timezone, append offset
226 echo ' (' . $row->customerCheckin->timezone . ')';
227 }
228
229 // add duration
230 echo ' - ' . VikAppointments::formatMinutesToTime($row->duration);
231
232 if ($row->location)
233 {
234 ?>
235 <br />
236 <?php
237
238 echo $row->location->text;
239 }
240
241 /**
242 * Display service cost in case of additional options.
243 *
244 * @since 1.6.2
245 */
246 if ($row->totals->gross != $order->totals->gross)
247 {
248 ?>
249 <span style="float: right;">
250 <?php echo $currency->format($row->totals->gross); ?>
251 </span>
252 <?php
253 }
254 ?>
255 </div>
256
257 <?php
258 // check whether there's at least a public note to display to the user
259 $notes = $order->getUserNotes($row->id);
260
261 if ($notes && $notes[0]->content)
262 {
263 // display only the latest modified note
264 ?>
265 <blockquote style="margin: 0; padding: 0px 25px; font-style: italic; color: brown; font-size: 13px;">
266 <?php
267 // display short description of the content (if specified)
268 echo VikAppointments::renderHtmlDescription($notes[0]->content, 'paymentconfirm');
269 ?>
270 </blockquote>
271 <?php
272 }
273
274 if ($row->options)
275 {
276 ?>
277 <div style="border-top: 1px solid #ddd; padding: 10px; background-color: #eee;">
278 <?php
279 foreach ($row->options as $opt)
280 {
281 ?>
282 <div style="padding: 2px 0; width: 100%; display: inline-block;">
283 <div style="float: left; display: inline-block; text-align: left;">
284 <?php
285 if ($opt->multiple || $opt->quantity > 1)
286 {
287 ?>
288 <small>
289 <?php echo $opt->quantity; ?>x
290 </small>
291 <?php
292 }
293
294 echo $opt->fullName;
295
296 if ($opt->duration)
297 {
298 ?>
299 <small style="margin-left: 10px; display: inline-block;">
300 <?php echo '+' . VikAppointments::formatMinutesToTime($opt->duration->extraTotal); ?>
301 </small>
302 <?php
303 }
304 ?>
305 </div>
306 <?php
307 if ((float) $opt->totals->gross)
308 {
309 ?>
310 <div style="float: right; display: inline-block; text-align: right;">
311 <?php echo $currency->format($opt->totals->gross); ?>
312 </div>
313 <?php
314 }
315 ?>
316 </div>
317 <?php
318 }
319 ?>
320 </div>
321 <?php
322 }
323
324 if ($row->totals->grossOpt > 0)
325 {
326 ?>
327 <div style="border-top: 1px solid #ddd; padding: 5px 10px; text-align: right;">
328 <span><?php echo $currency->format($row->totals->grossOpt); ?></span>
329 </div>
330 <?php
331 }
332 ?>
333
334 </div>
335 </td>
336 </tr>
337
338 </table>
339 </td>
340 </tr>
341
342 <?php
343 // end for
344 }
345 ?>
346
347 <!-- USER NOTES -->
348
349 <?php
350 // check whether there's at least a public note to display to the user
351 // that belong to the multi-order
352 $notes = $order->getUserNotes($order->id);
353
354 if ($notes && $notes[0]->content && count($order->appointments) > 1)
355 {
356 // display only the latest modified note
357 ?>
358 <tr>
359 <td style="padding: 0; text-align: center;">
360 <table width="100%" style="border-spacing: 0; margin: 10px auto 0; padding: 0; font-size: 14px; background: #f2f3f7;">
361 <tr>
362 <td style="padding: 0; line-height: 1.4em; text-align: left;">
363 <div style="background: #eee; border-bottom: 1px solid #ddd; padding: 10px;"><?php echo JText::translate('VAPMANAGERESERVATIONTITLE4'); ?></div>
364 <blockquote style="margin: 0; padding: 0px 25px; font-style: italic; color: brown; font-size: 13px;">
365 <?php
366 // display short description of the content (if specified)
367 echo VikAppointments::renderHtmlDescription($notes[0]->content, 'paymentconfirm');
368 ?>
369 </blockquote>
370 </td>
371 </tr>
372 </table>
373 </td>
374 </tr>
375 <?php
376 }
377 ?>
378
379 <!-- CUSTOMER DETAILS -->
380
381 <tr>
382 <td style="padding: 0; text-align: center;">
383 <table width="100%" style="border-spacing: 0; margin: 10px auto 0; padding: 0; font-size: 14px; background: #f2f3f7;">
384 <tr>
385 <td style="padding: 0; line-height: 1.4em; text-align: left;">
386 <div style="background: #eee; border-bottom: 1px solid #ddd; padding: 10px;"><?php echo JText::translate('VAPPERSONALDETAILS'); ?></div>
387 <div style="padding: 10px;">
388 <?php
389 foreach ($order->displayFields as $label => $value)
390 {
391 ?>
392 <div style="padding: 2px 0;">
393 <div style="display: inline-block; width: 180px;"><?php echo $label; ?></div>
394 <div style="display: inline-block;"><?php echo $value; ?></div>
395 </div>
396 <?php
397 }
398 ?>
399 </div>
400 </td>
401 </tr>
402 </table>
403 </td>
404 </tr>
405
406 <!-- ATTENDEES -->
407
408 <?php
409 if ($order->attendees)
410 {
411 ?>
412 <tr>
413 <td style="padding: 0; text-align: center;">
414 <?php
415 foreach ($order->attendees as $i => $attendee)
416 {
417 if (empty($attendee['display']))
418 {
419 // skip in case there's nothing to display
420 continue;
421 }
422
423 ?>
424 <table width="100%" style="border-spacing: 0; margin: 10px auto 0; padding: 0; font-size: 14px; background: #f2f3f7;">
425 <tr>
426 <td style="padding: 0; line-height: 1.4em; text-align: left;">
427 <div style="background: #eee; border-bottom: 1px solid #ddd; padding: 10px;"><?php echo JText::sprintf('VAP_N_ATTENDEE', $i + 2); ?></div>
428 <div style="padding: 10px; background-color: #f2f3f7;">
429 <?php
430 foreach ($attendee['display'] as $label => $value)
431 {
432 ?>
433 <div style="padding: 2px 0;">
434 <div style="display: inline-block; width: 180px;"><?php echo $label; ?></div>
435 <div style="display: inline-block;"><?php echo $value; ?></div>
436 </div>
437 <?php
438 }
439 ?>
440 </div>
441 </td>
442 </tr>
443 </table>
444 <?php
445 }
446 ?>
447 </td>
448 </tr>
449 <?php
450 }
451 ?>
452
453 <!-- CUSTOM POSITION BOTTOM -->
454
455 <tr>
456 <td style="padding: 0; text-align: center;">
457 <table width="100%" style="border-spacing: 0; margin: 0 auto;">
458 <tr>
459 <td>
460 {custom_position_bottom}
461 </td>
462 </tr>
463 </table>
464 </td>
465 </tr>
466
467 <!-- ORDER LINK -->
468
469 <tr class="no-printable">
470 <td style="padding: 0; text-align: center;">
471 <table width="100%" style="border-spacing: 0; margin: 10px auto 0; padding: 0; font-size: 14px; background: #f2f3f7;">
472 <tr>
473 <td style="padding: 0; line-height: 1.4em; text-align: left;">
474 <div style="background: #eee; border-bottom: 1px solid #ddd; padding: 10px;"><?php echo JText::translate('VAPORDERLINK'); ?></div>
475 <div style="padding: 10px;">
476 <a href="{order_link}" target="_blank" style="word-break: break-word;">{order_link}</a>
477 </div>
478 </td>
479 </tr>
480 </table>
481 </td>
482 </tr>
483
484 <!-- CANCELLATION LINK -->
485
486 <?php
487 if (JHtml::fetch('vaphtml.status.isapproved', 'appointments', $order->status) && VAPFactory::getConfig()->getBool('enablecanc'))
488 {
489 ?>
490 <tr class="no-printable">
491 <td style="padding: 0; text-align: center;">
492 <table width="100%" style="border-spacing: 0; margin: 10px auto 0; padding: 0; font-size: 14px; background: #f2f3f7;">
493 <tr>
494 <td style="padding: 0; line-height: 1.4em; text-align: left;">
495 <div style="background: #eee; border-bottom: 1px solid #ddd; padding: 10px;"><?php echo JText::translate('VAPCANCELLATIONLINK'); ?></div>
496 <div style="padding: 10px;">
497 <a href="{cancellation_link}" target="_blank" style="word-break: break-word;">{cancellation_link}</a>
498 </div>
499 </td>
500 </tr>
501 </table>
502 </td>
503 </tr>
504 <?php
505 }
506 ?>
507
508 <!-- CONFIRMATION LINK -->
509
510 <?php
511 if (VikAppointments::canUserApproveOrder($order))
512 {
513 ?>
514 <tr class="no-printable">
515 <td style="padding: 0; text-align: center;">
516 <table width="100%" style="border-spacing: 0; margin: 10px auto 0; padding: 0; font-size: 14px; background: #f2f3f7;">
517 <tr>
518 <td style="padding: 0; line-height: 1.4em; text-align: left;">
519 <div style="background: #eee; border-bottom: 1px solid #ddd; padding: 10px;"><?php echo JText::translate('VAPCONFIRMATIONLINK'); ?></div>
520 <div style="padding: 10px;">
521 <a href="{confirmation_link}" target="_blank" style="word-break: break-word;">{confirmation_link}</a>
522 </div>
523 </td>
524 </tr>
525 </table>
526 </td>
527 </tr>
528 <?php
529 }
530 ?>
531
532 <!-- CUSTOM POSITION FOOTER -->
533
534 <tr>
535 <td style="padding: 0; text-align: center;">
536 <table width="100%" style="border-spacing: 0; margin: 0 auto;">
537 <tr>
538 <td style="">
539 {custom_position_footer}
540 </td>
541 </tr>
542 </table>
543 </td>
544 </tr>
545
546 </table>
547
548 <!--[if (gte mso 9)|(IE)]>
549 </td>
550 </tr>
551 </table>
552 <![endif]-->
553
554 </div>
555 </div>
556
557 <?php
558 /**
559 * @var string|null {logo} The logo image of your company. Null if not specified.
560 * @var int {order_number} The unique ID of the reservation.
561 * @var string {order_key} The serial key of the reservation.
562 * @var string {order_status} The status of the order.
563 * @var string|null {order_payment} The name of the payment processor selected, otherwise NULL.
564 * @var string|null {order_payment_notes} The notes of the payment processor selected, otherwise NULL.
565 * @var float {order_total_cost} The total cost of the order.
566 * @var float {order_total_net} The total net of the order.
567 * @var float {order_total_tax} The total taxes of the order.
568 * @var float {order_total_discount} The total discount of the order.
569 * @var string {order_coupon_code} The coupon code used for the order.
570 * @var string {order_link} The direct url to the page of the order.
571 * @var string {cancellation_link} The direct url to cancel the order.
572 * @var string {confirmation_link} The direct url to confirm the order.
573 * @var string|null {company_name} The name of the company.
574 * @var string|null {user_name} The name of the user account.
575 * @var string|null {user_username} The username of the user account.
576 * @var string|null {user_email} The e-mail address of the user account.
577 * @var string|null {custom_position_top} This tag will be replaced with all the Custom Text Contents assigned to the top position.
578 * @var string|null {custom_position_middle} This tag will be replaced with all the Custom Text Contents assigned to the middle position.
579 * @var string|null {custom_position_bottom} This tag will be replaced with all the Custom Text Contents assigned to the bottom position.
580 * @var string|null {custom_position_footer} This tag will be replaced with all the Custom Text Contents assigned to the footer position.
581 */
582