| @@ -31,19 +31,38 @@ | ||
| 31 | 31 | $timetics_meeting_id = $this->meeting->get_id(); |
| 32 | 32 | $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(); |
| 33 | 33 | $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(); |
| 34 | 34 | |
| 35 | + $timetics_login_url = wp_login_url(); | |
| 36 | + $timetics_login_username = $timetics_customer_email; | |
| 37 | + $timetics_set_password_url = ''; | |
| 35 | 38 | |
| 39 | + $timetics_customer_user = get_user_by( 'id', $this->customer->get_id() ); | |
| 40 | + | |
| 41 | + if ( $timetics_customer_user ) { | |
| 42 | + $timetics_reset_key = get_password_reset_key( $timetics_customer_user ); | |
| 43 | + | |
| 44 | + if ( ! is_wp_error( $timetics_reset_key ) ) { | |
| 45 | + $timetics_set_password_url = network_site_url( | |
| 46 | + 'wp-login.php?action=rp&key=' . $timetics_reset_key . '&login=' . rawurlencode( $timetics_customer_user->user_login ), | |
| 47 | + 'login' | |
| 48 | + ); | |
| 49 | + } | |
| 50 | + } | |
| 51 | + | |
| 36 | 52 | $timetics_placeholders = [ |
| 37 | - '{%meeting_title%}' => $this->meeting->get_name(), | |
| 38 | - '{%meeting_date%}' => $timetics_date, | |
| 39 | - '{%meeting_time%}' => $timetics_time, | |
| 40 | - '{%meeting_location%}' => $timetics_location, | |
| 41 | - '{%meeting_duration%}' => $this->meeting->get_duration(), | |
| 42 | - '{%host_name%}' => $timetics_staff_name, | |
| 43 | - '{%host_email%}' => $this->staff->get_email(), | |
| 44 | - '{%customer_name%}' => $timetics_customer_name, | |
| 45 | - '{%customer_email%}' => $timetics_customer_email, | |
| 53 | + '{%meeting_title%}' => $this->meeting->get_name(), | |
| 54 | + '{%meeting_date%}' => $timetics_date, | |
| 55 | + '{%meeting_time%}' => $timetics_time, | |
| 56 | + '{%meeting_location%}' => $timetics_location, | |
| 57 | + '{%meeting_duration%}' => $this->meeting->get_duration(), | |
| 58 | + '{%host_name%}' => $timetics_staff_name, | |
| 59 | + '{%host_email%}' => $this->staff->get_email(), | |
| 60 | + '{%customer_name%}' => $timetics_customer_name, | |
| 61 | + '{%customer_email%}' => $timetics_customer_email, | |
| 62 | + '{%login_url%}' => $timetics_login_url, | |
| 63 | + '{%login_username%}' => $timetics_login_username, | |
| 64 | + '{%set_password_url%}' => $timetics_set_password_url, | |
| 46 | 65 | ]; |
| 47 | 66 | ?> |
| 48 | 67 | |
| 49 | 68 | <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;"> |
| @@ -87,9 +106,9 @@ | ||
| 87 | 106 | |
| 88 | 107 | <?php else: ?> |
| 89 | 108 | <p class="greeting" style="color: #556880; margin-bottom: 5px"> |
| 90 | 109 | <?php |
| 91 | - /* translators: %s: Customer name */ | |
| 110 | + /* translators: %s: Recipient name */ | |
| 92 | 111 | printf( esc_html__( 'Hi %s,', 'timetics' ), esc_html( $timetics_customer_name ) );?> |
| 93 | 112 | </p> |
| 94 | 113 | |
| 95 | 114 | <p style="color: #556880; margin-bottom: 5px"><?php esc_attr_e( 'A new meeting has been scheduled', 'timetics' );?></p> |