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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-note.php
woocommerce / includes / emails Last commit date
class-wc-email-cancelled-order.php 6 months ago class-wc-email-customer-cancelled-order.php 6 months ago class-wc-email-customer-completed-order.php 6 months ago class-wc-email-customer-failed-order.php 6 months ago class-wc-email-customer-fulfillment-created.php 4 months ago class-wc-email-customer-fulfillment-deleted.php 4 months ago class-wc-email-customer-fulfillment-updated.php 4 months ago class-wc-email-customer-invoice.php 6 months ago class-wc-email-customer-new-account.php 6 months ago class-wc-email-customer-note.php 6 months ago class-wc-email-customer-on-hold-order.php 6 months ago class-wc-email-customer-pos-completed-order.php 6 months ago class-wc-email-customer-pos-refunded-order.php 6 months ago class-wc-email-customer-processing-order.php 6 months ago class-wc-email-customer-refunded-order.php 6 months ago class-wc-email-customer-reset-password.php 6 months ago class-wc-email-failed-order.php 6 months ago class-wc-email-new-order.php 6 months ago class-wc-email.php 4 months ago
class-wc-email-customer-note.php
199 lines
1 <?php
2 /**
3 * Class WC_Email_Customer_Note 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_Note', false ) ) :
13
14 /**
15 * Customer Note Order Email.
16 *
17 * Customer note emails are sent when you add a note to an order.
18 *
19 * @class WC_Email_Customer_Note
20 * @version 3.5.0
21 * @package WooCommerce\Classes\Emails
22 * @extends WC_Email
23 */
24 class WC_Email_Customer_Note extends WC_Email {
25
26 /**
27 * Customer note.
28 *
29 * @var string
30 */
31 public $customer_note;
32
33 /**
34 * Constructor.
35 */
36 public function __construct() {
37 $this->id = 'customer_note';
38 $this->customer_email = true;
39 $this->title = __( 'Customer note', 'woocommerce' );
40 $this->email_group = 'order-changes';
41 $this->template_html = 'emails/customer-note.php';
42 $this->template_plain = 'emails/plain/customer-note.php';
43 $this->placeholders = array(
44 '{order_date}' => '',
45 '{order_number}' => '',
46 );
47
48 // Triggers.
49 add_action( 'woocommerce_new_customer_note_notification', array( $this, 'trigger' ) );
50
51 // Call parent constructor.
52 parent::__construct();
53
54 // Must be after parent's constructor which sets `email_improvements_enabled` property.
55 $this->description = $this->email_improvements_enabled
56 ? __( 'Send an email to customers notifying them when you’ve added a note to their order', 'woocommerce' )
57 : __( 'Customer note emails are sent when you add a note to an order.', 'woocommerce' );
58
59 if ( $this->block_email_editor_enabled ) {
60 $this->title = __( 'Customer note added', 'woocommerce' );
61 $this->description = __( 'Notifies customers when you’ve added a note to their order.', 'woocommerce' );
62 }
63 }
64
65 /**
66 * Get email subject.
67 *
68 * @since 3.1.0
69 * @return string
70 */
71 public function get_default_subject() {
72 return $this->email_improvements_enabled
73 ? __( 'A note has been added to your order from {site_title}', 'woocommerce' )
74 : __( 'Note added to your {site_title} order from {order_date}', 'woocommerce' );
75 }
76
77 /**
78 * Get email heading.
79 *
80 * @since 3.1.0
81 * @return string
82 */
83 public function get_default_heading() {
84 return __( 'A note has been added to your order', 'woocommerce' );
85 }
86
87 /**
88 * Trigger.
89 *
90 * @param array $args Email arguments.
91 */
92 public function trigger( $args ) {
93 $this->setup_locale();
94
95 if ( ! empty( $args ) ) {
96 $defaults = array(
97 'order_id' => '',
98 'customer_note' => '',
99 );
100
101 $args = wp_parse_args( $args, $defaults );
102
103 $order_id = $args['order_id'];
104 $customer_note = $args['customer_note'];
105
106 if ( $order_id ) {
107 $this->object = wc_get_order( $order_id );
108
109 if ( $this->object ) {
110 $this->recipient = $this->object->get_billing_email();
111 $this->customer_note = $customer_note;
112 $this->placeholders['{order_date}'] = wc_format_datetime( $this->object->get_date_created() );
113 $this->placeholders['{order_number}'] = $this->object->get_order_number();
114 }
115 }
116 }
117
118 if ( $this->is_enabled() && $this->get_recipient() ) {
119 $this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
120 }
121
122 $this->restore_locale();
123 }
124
125 /**
126 * Get content html.
127 *
128 * @return string
129 */
130 public function get_content_html() {
131 return wc_get_template_html(
132 $this->template_html,
133 array(
134 'order' => $this->object,
135 'email_heading' => $this->get_heading(),
136 'additional_content' => $this->get_additional_content(),
137 'customer_note' => $this->customer_note,
138 'sent_to_admin' => false,
139 'plain_text' => false,
140 'email' => $this,
141 )
142 );
143 }
144
145 /**
146 * Get content plain.
147 *
148 * @return string
149 */
150 public function get_content_plain() {
151 return wc_get_template_html(
152 $this->template_plain,
153 array(
154 'order' => $this->object,
155 'email_heading' => $this->get_heading(),
156 'additional_content' => $this->get_additional_content(),
157 'customer_note' => $this->customer_note,
158 'sent_to_admin' => false,
159 'plain_text' => true,
160 'email' => $this,
161 )
162 );
163 }
164
165 /**
166 * Default content to show below main email content.
167 *
168 * @since 3.7.0
169 * @return string
170 */
171 public function get_default_additional_content() {
172 return $this->email_improvements_enabled
173 ? __( 'Thanks again! If you need any help with your order, please contact us at {store_email}.', 'woocommerce' )
174 : __( 'Thanks for reading.', 'woocommerce' );
175 }
176
177 /**
178 * Get block editor email template content.
179 *
180 * @return string
181 */
182 public function get_block_editor_email_template_content() {
183 return wc_get_template_html(
184 $this->template_block_content,
185 array(
186 'order' => $this->object,
187 'customer_note' => $this->customer_note,
188 'sent_to_admin' => false,
189 'plain_text' => false,
190 'email' => $this,
191 )
192 );
193 }
194 }
195
196 endif;
197
198 return new WC_Email_Customer_Note();
199