PluginProbe
Timetics – Appointment Booking Calendar & Scheduling / 1.0.64
Timetics – Appointment Booking Calendar & Scheduling v1.0.64
1.0.64 1.0.62 1.0.63 1.0.61 1.0.60 1.0.59 1.0.58 1.0.57 1.0.56 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 All 65 releases
← All changes | templates/emails/new-event.php +56 -46 1.0.13 → 1.0.64 View file →
@@ -1,41 +1,47 @@
1 1 <?php
2 - $staff_name = $this->staff->get_display_name();
3 - $customer_name = $this->customer->get_display_name();
4 - $customer_email = $this->customer->get_email();
5 - $title = $this->get_title();
6 - $description = $this->meeting->get_description();
7 - $location = $this->booking->get_location();
8 - $location_type = $this->booking->get_location_type();
2 +defined( 'ABSPATH' ) || exit;
9 3
10 - $event = $this->booking->get_event();
11 - $join_link = 'google-meet' === $location_type && ! empty( $event['hangoutLink'] ) ? $event['hangoutLink'] : '';
12 - $timezone = $this->booking->get_timezone();
13 - $staff_timezone = $this->meeting->get_timezone();
4 + $timetics_staff_name = $this->staff->get_display_name();
5 + $timetics_customer_name = $this->customer->get_display_name();
6 + $timetics_customer_email = $this->customer->get_email();
7 + $timetics_title = $this->get_title();
8 + $timetics_description = $this->meeting->get_description();
9 + $timetics_location = $this->booking->get_location();
10 + $timetics_location_type = $this->booking->get_location_type();
14 11
15 - $dt = timetics_convert_timezone( $this->booking->get_start_date() . ' ' . $this->booking->get_start_time(), $timezone, $staff_timezone );
12 + $timetics_event = $this->booking->get_event();
13 + $timetics_join_link = 'google-meet' === $timetics_location_type && ! empty( $timetics_event['hangoutLink'] ) ? $timetics_event['hangoutLink'] : '';
14 + $timetics_timezone = $this->booking->get_timezone();
15 + $timetics_staff_timezone = $this->meeting->get_timezone();
16 16
17 - $day = $dt->format('l');
18 - $time = $dt->format('h:i a');
19 - $date = $dt->format('d F Y');
17 + $timetics_dt = timetics_convert_timezone( $this->booking->get_start_date() . ' ' . $this->booking->get_start_time(), $timetics_timezone, $timetics_staff_timezone );
20 18
21 - $email_body = timetics_get_option( 'booking_created_host_email_body' );
22 - $email_title = timetics_get_option( 'booking_created_host_email_title' );
23 - $email_title = ! empty( $email_title ) ? $email_title : $this->get_title();
19 + // Use WordPress date and time format settings
20 + $timetics_formatted = timetics_format_email_datetime( $this->booking->get_start_date(), $this->booking->get_start_time() );
21 + $timetics_day = $timetics_formatted['day'];
22 + $timetics_time = $timetics_formatted['time'];
23 + $timetics_date = $timetics_formatted['date'];
24 24
25 - $booking_cancel_url = $this->meeting->get_appointment_permalink() . '?id=' . $this->booking->get_id() . '&booking_action=cancel';
26 - $booking_reschedule_url = $this->meeting->get_appointment_permalink() . '?id=' . $this->booking->get_id() . '&booking_action=reschedule';
25 + $timetics_email_body = timetics_get_option( 'booking_created_host_email_body' );
26 + $timetics_email_title = timetics_get_option( 'booking_created_host_email_title' );
27 + $timetics_email_title = ! empty( $timetics_email_title ) ? $timetics_email_title : $this->get_title();
28 +
29 + $timetics_meeting_id = $this->meeting->get_id();
30 + $timetics_booking_cancel_url = $this->meeting->get_appointment_permalink() . '?id=' . $this->booking->get_id() . '&meeting_id=' . $this->meeting->get_id() .'&booking_action=cancel'. '&appointment_token=' . $this->booking->get_security_token();
31 + $timetics_booking_reschedule_url = $this->meeting->get_appointment_permalink() . '?id=' . $this->booking->get_id() . '&meeting_id=' . $this->meeting->get_id() . '&booking_action=reschedule'. '&appointment_token='. $this->booking->get_security_token();
27 32
28 - $placeholders = [
29 - '{%meeting_title%}' => $this->meeting->name,
30 - '{%meeting_date%}' => $date,
31 - '{%meeting_time%}' => $time,
32 - '{%meeting_location%}' => $location,
33 - '{%meeting_duration%}' => $this->meeting->duration,
34 - '{%host_name%}' => $staff_name,
33 +
34 + $timetics_placeholders = [
35 + '{%meeting_title%}' => $this->meeting->get_name(),
36 + '{%meeting_date%}' => $timetics_date,
37 + '{%meeting_time%}' => $timetics_time,
38 + '{%meeting_location%}' => $timetics_location,
39 + '{%meeting_duration%}' => $this->meeting->get_duration(),
40 + '{%host_name%}' => $timetics_staff_name,
35 41 '{%host_email%}' => $this->staff->get_email(),
36 - '{%customer_name%}' => $customer_name,
37 - '{%customer_email%}' => $customer_email,
42 + '{%customer_name%}' => $timetics_customer_name,
43 + '{%customer_email%}' => $timetics_customer_email,
38 44 ];
39 45 ?>
40 46
41 47 <div class="email-wrapper" style="margin-bottom: 30px; background-color: #f4f5f7; font-family: -apple-system,BlinkMacSystemFont,'Segoe UI','Noto Sans',Helvetica,Arial,sans-serif,'Apple Color Emoji','Segoe UI Emoji', sans-serif;">
@@ -43,16 +49,16 @@
43 49 <div class="email-content" style="padding: 40px; background-color: #ffffff; border-radius: 0 0 12px 12px; border-top: 4px solid #3161F1; margin-bottom: 40px;">
44 50 <?php do_action('timetics_email_header') ;?>
45 51 <div class="email-title">
46 52 <h3 style="color: #3161F1; font-size: 24px; font-weight: 600; margin: 30px 0;">
47 - <?php echo esc_html( timetics_replace_placeholder( $email_title, $placeholders ) ); ?>
53 + <?php echo esc_html( timetics_replace_placeholder( $timetics_email_title, $timetics_placeholders ) ); ?>
48 54 </h3>
49 55 </div>
50 56
51 - <?php if ( $email_body ): ?>
57 + <?php if ( $timetics_email_body ): ?>
52 58
53 - <?php echo timetics_replace_placeholder( $email_body, $placeholders ); ?>
54 - <?php if ( 'google-meet' === $location_type && $join_link ): ?>
59 + <?php echo wp_kses( timetics_replace_placeholder( $timetics_email_body, $timetics_placeholders ), 'post' ); ?>
60 + <?php if ( 'google-meet' === $timetics_location_type && $timetics_join_link ): ?>
55 61 <div class="single-data-entry" style="margin: 10px 0 20px;">
56 62 <p style="font-weight: 600; font-size: 14px; line-height: 1; color: #0C274A; margin: 0 0 5px;">
57 63 <?php esc_html_e( 'Location:', 'timetics' );?>
58 64 </p>
@@ -57,9 +63,9 @@
57 63 <?php esc_html_e( 'Location:', 'timetics' );?>
58 64 </p>
59 65 <p style="font-weight: 400; font-size: 14px; color: #556880; margin: 0;">
60 66 <?php echo esc_html__('Joining link:', 'timetics') ;?>
61 - <a style="color: #3161F1" href="<?php echo esc_url( $join_link ); ?>"><?php echo esc_url( $join_link ); ?></a>
67 + <a style="color: #3161F1" href="<?php echo esc_url( $timetics_join_link ); ?>"><?php echo esc_url( $timetics_join_link ); ?></a>
62 68 </p>
63 69 </div>
64 70 <?php else : ?>
65 71 <div class="single-data-entry" style="margin: 10px 0 20px;">
@@ -66,9 +72,9 @@
66 72 <p style="font-weight: 600; font-size: 14px; line-height: 1; color: #0C274A; margin: 0 0 5px;">
67 73 <?php esc_html_e( 'Location:', 'timetics' );?>
68 74 </p>
69 75 <p style="font-weight: 400; font-size: 14px; color: #556880; margin: 0;">
70 - <?php echo esc_html($location) ;?>
76 + <?php echo esc_html($timetics_location) ;?>
71 77 </p>
72 78 </div>
73 79 <?php endif; ?>
74 80 <?php do_action( 'timetics_new_event_email', $this->booking, 'staff' ); ?>
@@ -74,9 +80,11 @@
74 80 <?php do_action( 'timetics_new_event_email', $this->booking, 'staff' ); ?>
75 81
76 82 <?php else: ?>
77 83 <p class="greeting" style="color: #556880; margin-bottom: 5px">
78 - <?php printf( esc_html__( 'Hi %s,', 'timetics' ), esc_html( $staff_name ) );?>
84 + <?php
85 + /* translators: %s: Recipient name */
86 + printf( esc_html__( 'Hi %s,', 'timetics' ), esc_html( $timetics_staff_name ) );?>
79 87 </p>
80 88
81 89 <p style="color: #556880; margin-bottom: 5px"><?php esc_attr_e( 'A new meeting has been scheduled', 'timetics' );?></p>
82 90
@@ -83,9 +91,9 @@
83 91 <div class="data-wrapper" style="border: 1px solid #E2ECF4; border-radius: 12px; padding: 30px; margin: 24px 0;">
84 92 <div class="single-data-entry" style="margin: 0 0 20px;">
85 93 <p style="font-weight: 600; font-size: 14px; line-height: 1; color: #0C274A; margin: 0 0 5px;"><?php echo esc_html__( 'Meeting Name:', 'timetics' ); ?></p>
86 94 <p style="font-weight: 400; font-size: 14px; color: #556880; margin: 0;">
87 - <?php echo esc_html( timetics_replace_placeholder( $email_title, $placeholders ) ); ?>
95 + <?php echo esc_html( timetics_replace_placeholder( $timetics_email_title, $timetics_placeholders ) ); ?>
88 96 </p>
89 97
90 98 </div>
91 99 <div class="single-data-entry" style="margin: 0 0 20px;">
@@ -90,36 +98,38 @@
90 98 </div>
91 99 <div class="single-data-entry" style="margin: 0 0 20px;">
92 100 <p style="font-weight: 600; font-size: 14px; line-height: 1; color: #0C274A; margin: 0 0 5px;"><?php echo esc_html__( 'Invitee:', 'timetics' ); ?></p>
93 101 <p style="font-weight: 400; font-size: 14px; color: #556880; margin: 0;">
94 - <?php echo esc_html( $customer_name );?> -
95 - <a style="color: #3161F1" href="mailto:<?php echo esc_attr( $customer_email )?>"><?php echo esc_html( $customer_email ); ?></a>
102 + <?php echo esc_html( $timetics_customer_name );?> -
103 + <a style="color: #3161F1" href="mailto:<?php echo esc_attr( $timetics_customer_email )?>"><?php echo esc_html( $timetics_customer_email ); ?></a>
96 104 </p>
97 105 </div>
98 106
99 107 <div class="single-data-entry" style="margin: 10px 0 20px;">
100 108 <p style="font-weight: 600; font-size: 14px; line-height: 1; color: #0C274A; margin: 0 0 5px;"><?php echo esc_html__( 'Date and time:', 'timetics' ); ?></p>
101 - <p style="font-weight: 400; font-size: 14px; color: #556880; margin: 0;"><?php printf( esc_html__( '%s, %s %s (%s)', 'timetics' ), esc_html( $time ), esc_html( $day ), esc_html( $date ), esc_html( $staff_timezone ) );?></p>
109 + <p style="font-weight: 400; font-size: 14px; color: #556880; margin: 0;"><?php
110 + /* translators: 1: Time, 2: Day, 3: Date, 4: Timezone */
111 + printf( esc_html__( '%1$s, %2$s %3$s (%4$s)', 'timetics' ), esc_html( $timetics_time ), esc_html( $timetics_day ), esc_html( $timetics_date ), esc_html( $timetics_staff_timezone ) );?></p>
102 112 </div>
103 113
104 - <?php if ( 'google-meet' === $location_type && $join_link ): ?>
114 + <?php if ( 'google-meet' === $timetics_location_type && $timetics_join_link ): ?>
105 115 <div class="single-data-entry" style="margin: 10px 0 20px;">
106 116 <p style="font-weight: 600; font-size: 14px; line-height: 1; color: #0C274A; margin: 0 0 5px;">
107 117 <?php esc_html_e( 'Location:', 'timetics' );?>
108 118 </p>
109 - <img width="110" style="margin: 5px 0;" src="https://arraytics.dev/social-icons/google-meet.png" alt="Google Meet">
119 + <img width="110" style="margin: 5px 0;" src="<?php echo esc_url( TIMETICS_PLUGIN_URL . 'assets/images/social-icons/google-meet.svg' ); ?>" alt="Google Meet">
110 120 <p style="font-weight: 400; font-size: 14px; color: #556880; margin: 0;">
111 121 <?php echo esc_html__('Joining link:', 'timetics') ;?>
112 - <a style="color: #3161F1" href="<?php echo esc_url( $join_link ); ?>"><?php echo esc_url( $join_link ); ?></a>
122 + <a style="color: #3161F1" href="<?php echo esc_url( $timetics_join_link ); ?>"><?php echo esc_url( $timetics_join_link ); ?></a>
113 123 </p>
114 124 </div>
115 125 <?php endif;?>
116 126
117 127 <?php do_action( 'timetics_new_event_email', $this->booking, 'staff' ); ?>
118 - <?php if($timezone) :?>
128 + <?php if($timetics_timezone) :?>
119 129 <div class="single-data-entry" style="margin: 10px 0 20px;">
120 130 <p style="font-weight: 600; font-size: 14px; line-height: 1; color: #0C274A; margin: 0 0 5px;"><?php echo esc_html__( 'Invitee Time Zone:', 'timetics' ); ?></p>
121 - <p style="font-weight: 400; font-size: 14px; color: #556880; margin: 0;"><?php echo esc_html( $timezone ); ?></p>
131 + <p style="font-weight: 400; font-size: 14px; color: #556880; margin: 0;"><?php echo esc_html( $timetics_timezone ); ?></p>
122 132 </div>
123 133 <?php endif;?>
124 134 </div>
125 135 <?php endif;?>
@@ -125,7 +135,7 @@
125 135 <?php endif;?>
126 136
127 137 <p style="font-weight: 400; font-size: 14px; color: #556880; margin: 0;"><?php echo esc_html__('Thank you!', 'timetics'); ?></p>
128 138 </div>
129 - <?php do_action('timetics_email_footer', $customer_email) ;?>
139 + <?php do_action('timetics_email_footer', $timetics_customer_email) ;?>
130 140 </div>
131 141 </div>