PluginProbe ʕ •ᴥ•ʔ
Appointment Booking Plugin – LatePoint | Calendar & Scheduling for WordPress / 5.1.6
Appointment Booking Plugin – LatePoint | Calendar & Scheduling for WordPress v5.1.6
5.6.8 5.6.7 5.6.6 5.6.5 5.6.4 5.6.3 5.6.2 5.6.1 5.6.0 5.5.2 5.5.1 5.5.0 5.4.2 trunk 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 5.1.6 5.1.7 5.1.8 5.1.9 5.1.91 5.1.92 5.1.93 5.1.94 5.2.0 5.2.1 5.2.10 5.2.11 5.2.2 5.2.3 5.2.4 5.2.5 5.2.6 5.2.7 5.2.8 5.2.9 5.3.0 5.3.1 5.3.2 5.4.0 5.4.1
latepoint / lib / mailers / customer_mailer.php
latepoint / lib / mailers Last commit date
agent_mailer.php 1 year ago customer_mailer.php 1 year ago mailer.php 1 year ago
customer_mailer.php
56 lines
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit; // Exit if accessed directly.
4 }
5
6
7 if ( ! class_exists( 'OsCustomerMailer' ) ) :
8
9
10 class OsCustomerMailer extends OsMailer {
11
12
13 function __construct() {
14 parent::__construct();
15 $this->views_folder = LATEPOINT_VIEWS_MAILERS_ABSPATH . 'customer/';
16 }
17
18
19 // PASSWORD RESET TOKEN
20
21 function password_reset_request( $customer, $token ) {
22 $this->vars['customer'] = $customer;
23 $to = $customer->email;
24 $subject = $this->password_reset_request_subject();
25 $message = $this->password_reset_request_content();
26 $subject = OsReplacerHelper::replace_all_vars( $subject, array( 'customer' => $customer, 'other_vars' => [ 'token' => $token ] ) );
27 $message = OsReplacerHelper::replace_all_vars( $message, array( 'customer' => $customer, 'other_vars' => [ 'token' => $token ] ) );
28
29 return wp_mail( $to, $subject, $message, $this->headers );
30 }
31
32 function password_reset_request_subject() {
33 $default = __( 'Reset Your Password', 'latepoint' );
34
35 return OsSettingsHelper::get_settings_value( 'email_customer_password_reset_request_subject', $default );
36 }
37
38 function password_reset_request_content() {
39 $content = OsSettingsHelper::get_settings_value( 'email_customer_password_reset_request_content' );
40 if ( ! $content ) {
41 require_once ABSPATH . 'wp-admin/includes/file.php';
42 if ( ! WP_Filesystem() ) {
43 OsDebugHelper::log( __( 'Failed to initialise WC_Filesystem API while trying to show notification templates.', 'latepoint' ) );
44
45 return '';
46 }
47 global $wp_filesystem;
48
49 return $wp_filesystem->get_contents( LATEPOINT_VIEWS_ABSPATH . 'mailers/customer/password_reset_request.html' );
50 } else {
51 return $content;
52 }
53 }
54 }
55
56 endif;