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.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-new-account.php
woocommerce / includes / emails Last commit date
class-wc-email-cancelled-order.php 3 years ago class-wc-email-customer-completed-order.php 5 years ago class-wc-email-customer-invoice.php 5 years ago class-wc-email-customer-new-account.php 4 years ago class-wc-email-customer-note.php 5 years ago class-wc-email-customer-on-hold-order.php 3 years ago class-wc-email-customer-processing-order.php 5 years ago class-wc-email-customer-refunded-order.php 5 years ago class-wc-email-customer-reset-password.php 5 years ago class-wc-email-failed-order.php 5 years ago class-wc-email-new-order.php 3 years ago class-wc-email.php 3 years ago
class-wc-email-customer-new-account.php
204 lines
1 <?php
2 /**
3 * Class WC_Email_Customer_New_Account 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_New_Account', false ) ) :
13
14 /**
15 * Customer New Account.
16 *
17 * An email sent to the customer when they create an account.
18 *
19 * @class WC_Email_Customer_New_Account
20 * @version 3.5.0
21 * @package WooCommerce\Classes\Emails
22 * @extends WC_Email
23 */
24 class WC_Email_Customer_New_Account extends WC_Email {
25
26 /**
27 * User login name.
28 *
29 * @var string
30 */
31 public $user_login;
32
33 /**
34 * User email.
35 *
36 * @var string
37 */
38 public $user_email;
39
40 /**
41 * User password.
42 *
43 * @var string
44 */
45 public $user_pass;
46
47 /**
48 * Is the password generated?
49 *
50 * @var bool
51 */
52 public $password_generated;
53
54 /**
55 * Magic link to set initial password.
56 *
57 * @var string
58 */
59 public $set_password_url;
60
61 /**
62 * Constructor.
63 */
64 public function __construct() {
65 $this->id = 'customer_new_account';
66 $this->customer_email = true;
67 $this->title = __( 'New account', 'woocommerce' );
68 $this->description = __( 'Customer "new account" emails are sent to the customer when a customer signs up via checkout or account pages.', 'woocommerce' );
69 $this->template_html = 'emails/customer-new-account.php';
70 $this->template_plain = 'emails/plain/customer-new-account.php';
71
72 // Call parent constructor.
73 parent::__construct();
74 }
75
76 /**
77 * Get email subject.
78 *
79 * @since 3.1.0
80 * @return string
81 */
82 public function get_default_subject() {
83 return __( 'Your {site_title} account has been created!', 'woocommerce' );
84 }
85
86 /**
87 * Get email heading.
88 *
89 * @since 3.1.0
90 * @return string
91 */
92 public function get_default_heading() {
93 return __( 'Welcome to {site_title}', 'woocommerce' );
94 }
95
96 /**
97 * Trigger.
98 *
99 * @param int $user_id User ID.
100 * @param string $user_pass User password.
101 * @param bool $password_generated Whether the password was generated automatically or not.
102 */
103 public function trigger( $user_id, $user_pass = '', $password_generated = false ) {
104 $this->setup_locale();
105
106 if ( $user_id ) {
107 $this->object = new WP_User( $user_id );
108
109 $this->user_pass = $user_pass;
110 $this->user_login = stripslashes( $this->object->user_login );
111 $this->user_email = stripslashes( $this->object->user_email );
112 $this->recipient = $this->user_email;
113 $this->password_generated = $password_generated;
114 $this->set_password_url = $this->generate_set_password_url();
115 }
116
117 if ( $this->is_enabled() && $this->get_recipient() ) {
118 $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
119 }
120
121 $this->restore_locale();
122 }
123
124 /**
125 * Get content html.
126 *
127 * @return string
128 */
129 public function get_content_html() {
130 return wc_get_template_html(
131 $this->template_html,
132 array(
133 'email_heading' => $this->get_heading(),
134 'additional_content' => $this->get_additional_content(),
135 'user_login' => $this->user_login,
136 'user_pass' => $this->user_pass,
137 'blogname' => $this->get_blogname(),
138 'password_generated' => $this->password_generated,
139 'sent_to_admin' => false,
140 'plain_text' => false,
141 'email' => $this,
142 'set_password_url' => $this->set_password_url,
143 )
144 );
145 }
146
147 /**
148 * Get content plain.
149 *
150 * @return string
151 */
152 public function get_content_plain() {
153 return wc_get_template_html(
154 $this->template_plain,
155 array(
156 'email_heading' => $this->get_heading(),
157 'additional_content' => $this->get_additional_content(),
158 'user_login' => $this->user_login,
159 'user_pass' => $this->user_pass,
160 'blogname' => $this->get_blogname(),
161 'password_generated' => $this->password_generated,
162 'sent_to_admin' => false,
163 'plain_text' => true,
164 'email' => $this,
165 'set_password_url' => $this->set_password_url,
166 )
167 );
168 }
169
170 /**
171 * Default content to show below main email content.
172 *
173 * @since 3.7.0
174 * @return string
175 */
176 public function get_default_additional_content() {
177 return __( 'We look forward to seeing you soon.', 'woocommerce' );
178 }
179
180 /**
181 * Generate set password URL link for a new user.
182 *
183 * See also Automattic\WooCommerce\Blocks\Domain\Services\Email\CustomerNewAccount and wp_new_user_notification.
184 *
185 * @since 6.0.0
186 * @return string
187 */
188 protected function generate_set_password_url() {
189 // Generate a magic link so user can set initial password.
190 $key = get_password_reset_key( $this->object );
191 if ( ! is_wp_error( $key ) ) {
192 $action = 'newaccount';
193 return wc_get_account_endpoint_url( 'lost-password' ) . "?action=$action&key=$key&login=" . rawurlencode( $this->object->user_login );
194 } else {
195 // Something went wrong while getting the key for new password URL, send customer to the generic password reset.
196 return wc_get_account_endpoint_url( 'lost-password' );
197 }
198 }
199 }
200
201 endif;
202
203 return new WC_Email_Customer_New_Account();
204