PluginProbe ʕ •ᴥ•ʔ
LatePoint – Calendar Booking Plugin for Appointments and Events / trunk
LatePoint – Calendar Booking Plugin for Appointments and Events vtrunk
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 3 months ago customer_mailer.php 3 months ago mailer.php 3 months ago
customer_mailer.php
69 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(
27 $subject,
28 array(
29 'customer' => $customer,
30 'other_vars' => [ 'token' => $token ],
31 )
32 );
33 $message = OsReplacerHelper::replace_all_vars(
34 $message,
35 array(
36 'customer' => $customer,
37 'other_vars' => [ 'token' => $token ],
38 )
39 );
40
41 return wp_mail( $to, $subject, $message, $this->headers );
42 }
43
44 function password_reset_request_subject() {
45 $default = __( 'Reset Your Password', 'latepoint' );
46
47 return OsSettingsHelper::get_settings_value( 'email_customer_password_reset_request_subject', $default );
48 }
49
50 function password_reset_request_content() {
51 $content = OsSettingsHelper::get_settings_value( 'email_customer_password_reset_request_content' );
52 if ( ! $content ) {
53 require_once ABSPATH . 'wp-admin/includes/file.php';
54 if ( ! WP_Filesystem() ) {
55 OsDebugHelper::log( __( 'Failed to initialise WC_Filesystem API while trying to show notification templates.', 'latepoint' ) );
56
57 return '';
58 }
59 global $wp_filesystem;
60
61 return $wp_filesystem->get_contents( LATEPOINT_VIEWS_ABSPATH . 'mailers/customer/password_reset_request.html' );
62 } else {
63 return $content;
64 }
65 }
66 }
67
68 endif;
69