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rc.2 3.1.0 6.2.1 3.1.1 6.2.2 3.1.2 6.2.3 3.2.0 6.3.0 3.2.1 6.3.0-beta.1 3.2.2 6.3.0-rc.1 3.2.3 6.3.0-rc.2 3.2.4 6.3.1 3.2.5 6.3.2 3.2.6 6.4.0 3.3.0 6.4.0-beta.1 3.3.1 6.4.0-rc.1 3.3.2 6.4.1 3.3.2-rc.1 6.4.2 3.3.3 6.5.0 3.3.4 6.5.0-beta.1 3.3.5 6.5.0-rc.1 3.3.6 6.5.0-rc.2 3.4.0 6.5.1 3.4.0-beta.1 6.5.2 3.4.0-rc.2 6.6.0 3.4.1 6.6.0-beta.1 3.4.2 6.6.0-rc.1 3.4.3 6.6.0-rc.2 3.4.4 6.6.1 3.4.5 6.6.2 3.4.6 6.7.0 3.4.7 6.7.0-beta.1 3.4.8 6.7.0-beta.2 3.5.0 6.7.0-rc.1 3.5.0-beta.1 6.7.1 3.5.0-rc.1 6.8.0 3.5.0-rc.2 6.8.0-beta.1 3.5.1 6.8.0-beta.2 3.5.10 6.8.0-rc.1 3.5.2 6.8.1 3.5.3 6.8.2 3.5.4 6.8.3 3.5.5 6.9.0 3.5.6 6.9.0-beta.1 3.5.7 6.9.0-beta.2 3.5.8 6.9.0-rc.1 3.5.9 6.9.1 3.6.0 6.9.2 3.6.0-beta.1 6.9.3 3.6.0-rc.1 6.9.4 3.6.0-rc.2 6.9.5 3.6.0-rc.3 7.0.0 3.6.1 7.0.0-beta.1 3.6.2 7.0.0-beta.2 3.6.3 7.0.0-beta.3 3.6.4 7.0.0-rc.1 3.6.5 7.0.0-rc.2 3.6.6 7.0.1 3.6.7 7.0.2 3.7.0 7.1.0 3.7.0-beta.1 7.1.0-beta.1 3.7.0-rc.1 7.1.0-beta.2 3.7.0-rc.2 7.1.0-rc.1 3.7.1 7.1.0-rc.2 3.7.2 7.1.1
woocommerce / includes / emails / class-wc-email-customer-reset-password.php
woocommerce / includes / emails Last commit date
class-wc-email-admin-payment-gateway-enabled.php 1 month ago class-wc-email-cancelled-order.php 1 month ago class-wc-email-customer-cancelled-order.php 1 month ago class-wc-email-customer-completed-order.php 1 month ago class-wc-email-customer-failed-order.php 1 month ago class-wc-email-customer-fulfillment-created.php 1 month ago class-wc-email-customer-fulfillment-deleted.php 1 month ago class-wc-email-customer-fulfillment-updated.php 1 month ago class-wc-email-customer-invoice.php 1 month ago class-wc-email-customer-new-account.php 1 month ago class-wc-email-customer-note.php 1 month ago class-wc-email-customer-on-hold-order.php 1 month ago class-wc-email-customer-partially-refunded-order.php 4 months ago class-wc-email-customer-pos-completed-order.php 1 month ago class-wc-email-customer-pos-refunded-order.php 1 month ago class-wc-email-customer-processing-order.php 1 month ago class-wc-email-customer-refunded-order.php 1 month ago class-wc-email-customer-reset-password.php 1 month ago class-wc-email-customer-review-request.php 1 month ago class-wc-email-failed-order.php 1 month ago class-wc-email-new-order.php 1 month ago class-wc-email.php 1 month ago
class-wc-email-customer-reset-password.php
226 lines
1 <?php
2 /**
3 * Class WC_Email_Customer_Reset_Password file.
4 *
5 * @package WooCommerce\Emails
6 */
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit; // Exit if accessed directly.
10 }
11
12 if ( ! class_exists( 'WC_Email_Customer_Reset_Password', false ) ) :
13
14 /**
15 * Customer Reset Password.
16 *
17 * An email sent to the customer when they reset their password.
18 *
19 * @class WC_Email_Customer_Reset_Password
20 * @version 3.5.0
21 * @package WooCommerce\Classes\Emails
22 * @extends WC_Email
23 */
24 class WC_Email_Customer_Reset_Password extends WC_Email {
25
26 /**
27 * User ID.
28 *
29 * @var integer
30 */
31 public $user_id;
32
33 /**
34 * User login name.
35 *
36 * @var string
37 */
38 public $user_login;
39
40 /**
41 * User email.
42 *
43 * @var string
44 */
45 public $user_email;
46
47 /**
48 * Reset key.
49 *
50 * @var string
51 */
52 public $reset_key;
53
54 /**
55 * User display name (first name, or login as fallback).
56 *
57 * @var string
58 */
59 public $user_display_name;
60
61 /**
62 * Constructor.
63 */
64 public function __construct() {
65
66 $this->id = 'customer_reset_password';
67 $this->customer_email = true;
68
69 $this->title = __( 'Reset password', 'woocommerce' );
70 $this->description = __( 'Send an email to customers notifying them that their password has been reset', 'woocommerce' );
71
72 $this->template_html = 'emails/customer-reset-password.php';
73 $this->template_plain = 'emails/plain/customer-reset-password.php';
74
75 $this->email_group = 'accounts';
76
77 // Trigger.
78 add_action( 'woocommerce_reset_password_notification', array( $this, 'trigger' ), 10, 2 );
79
80 // Call parent constructor.
81 parent::__construct();
82
83 // Must be after parent's constructor which sets `block_email_editor_enabled` property.
84 if ( $this->block_email_editor_enabled ) {
85 $this->title = __( 'Account password reset', 'woocommerce' );
86 $this->description = __( 'Notifies customers when their password has been reset.', 'woocommerce' );
87 }
88 }
89
90 /**
91 * Get email subject.
92 *
93 * @since 3.1.0
94 * @return string
95 */
96 public function get_default_subject() {
97 return $this->email_improvements_enabled
98 ? __( 'Reset your password for {site_title}', 'woocommerce' )
99 : __( 'Password Reset Request for {site_title}', 'woocommerce' );
100 }
101
102 /**
103 * Get email heading.
104 *
105 * @since 3.1.0
106 * @return string
107 */
108 public function get_default_heading() {
109 return $this->email_improvements_enabled
110 ? __( 'Reset your password', 'woocommerce' )
111 : __( 'Password Reset Request', 'woocommerce' );
112 }
113
114 /**
115 * Trigger.
116 *
117 * @param string $user_login User login.
118 * @param string $reset_key Password reset key.
119 */
120 public function trigger( $user_login = '', $reset_key = '' ) {
121 $this->setup_locale();
122
123 if ( $user_login && $reset_key ) {
124 $this->object = get_user_by( 'login', $user_login );
125 if ( ! $this->object ) {
126 $this->restore_locale();
127 return;
128 }
129 $this->user_id = $this->object->ID;
130 $this->user_login = $user_login;
131 $this->reset_key = $reset_key;
132 $this->user_email = stripslashes( $this->object->user_email );
133 $this->recipient = $this->user_email;
134 $customer = new WC_Customer( $this->object->ID );
135 $first_name = ! empty( $customer->get_billing_first_name() ) ? $customer->get_billing_first_name() : $this->object->first_name;
136 $this->user_display_name = ! empty( $first_name ) ? $first_name : $this->user_login;
137 }
138
139 $this->send_notification();
140
141 $this->restore_locale();
142 }
143
144 /**
145 * Get content html.
146 *
147 * @return string
148 */
149 public function get_content_html() {
150 return wc_get_template_html(
151 $this->template_html,
152 array(
153 'email_heading' => $this->get_heading(),
154 'user_id' => $this->user_id,
155 'user_login' => $this->user_login,
156 'user_display_name' => $this->user_display_name,
157 'reset_key' => $this->reset_key,
158 'blogname' => $this->get_blogname(),
159 'additional_content' => $this->get_additional_content(),
160 'sent_to_admin' => false,
161 'plain_text' => false,
162 'email' => $this,
163 )
164 );
165 }
166
167 /**
168 * Get content plain.
169 *
170 * @return string
171 */
172 public function get_content_plain() {
173 return wc_get_template_html(
174 $this->template_plain,
175 array(
176 'email_heading' => $this->get_heading(),
177 'user_id' => $this->user_id,
178 'user_login' => $this->user_login,
179 'user_display_name' => $this->user_display_name,
180 'reset_key' => $this->reset_key,
181 'blogname' => $this->get_blogname(),
182 'additional_content' => $this->get_additional_content(),
183 'sent_to_admin' => false,
184 'plain_text' => true,
185 'email' => $this,
186 )
187 );
188 }
189
190
191 /**
192 * Get block editor email template content.
193 *
194 * @return string
195 */
196 public function get_block_editor_email_template_content() {
197 return wc_get_template_html(
198 $this->template_block_content,
199 array(
200 'user_id' => $this->user_id,
201 'user_login' => $this->user_login,
202 'user_display_name' => $this->user_display_name,
203 'reset_key' => $this->reset_key,
204 'sent_to_admin' => false,
205 'plain_text' => false,
206 'email' => $this,
207 )
208 );
209 }
210
211
212 /**
213 * Default content to show below main email content.
214 *
215 * @since 3.7.0
216 * @return string
217 */
218 public function get_default_additional_content() {
219 return __( 'Thanks for reading.', 'woocommerce' );
220 }
221 }
222
223 endif;
224
225 return new WC_Email_Customer_Reset_Password();
226