PluginProbe
YayMail – WooCommerce Email Customizer / 1.9.6
YayMail – WooCommerce Email Customizer v1.9.6
4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 trunk 1.9.6 2.1.4 2.1.5 3.2.2 3.2.6 3.2.7.1 3.2.8.1 3.2.9 3.3 3.3.1 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9 3.4 3.4.1 All 57 releases
yaymail / includes / Templates / DefaultTemplate / CustomerRefundedOrder.php

CustomerRefundedOrder.php in YayMail – WooCommerce Email Customizer 1.9.6, at includes/Templates/DefaultTemplate/CustomerRefundedOrder.php

293 lines 14.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace YayMail\Templates\DefaultTemplate;
3
4 defined( 'ABSPATH' ) || exit;
5
6 class CustomerRefundedOrder {
7
8 protected static $instance = null;
9
10 public static function getInstance() {
11 if ( null == self::$instance ) {
12 self::$instance = new self();
13 }
14
15 return self::$instance;
16 }
17
18 public static function getTemplates() {
19 /*
20 @@@ Html default send email.
21 @@@ Note: Add characters '\' before special characters in a string.
22 @@@ Example: font-family: \'Helvetica Neue\'...
23 */
24 $emailTitle = __( 'Order Refunded: {order_number}', 'woocommerce' );
25 $emailTitle = str_replace( '{order_number}', '', $emailTitle );
26 $emailHi = esc_html__( 'Hi ', 'woocommerce' ) . esc_html( do_shortcode( '[yaymail_billing_first_name]' ) . ',' );
27 $emailtext = esc_html__( 'Your order on ', 'woocommerce' ) . esc_html( do_shortcode( '[yaymail_site_name]' ) ) . esc_html__( ' has been refunded. There are more details below for your reference:', 'woocommerce' );
28 $additionalContent = __( 'We hope to see you again soon.', 'woocommerce' );
29 $textShippingAddress = __( 'Shipping Address', 'woocommerce' );
30 $textBillingAddress = __( 'Billing Address', 'woocommerce' );
31
32 // Html
33 $html = '
34 <html>
35 <head>
36 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
37 </head>
38 <body style="background: rgb(236, 236, 236); padding: 0;">
39 <table width="605px" cellspacing="0" cellpadding="0" border="0" align="center" id="web8ffa62b5-7258-42cc-ba53-7ae69638c1fe" class="web-main-row" style="display: table; background-color: rgb(236, 236, 236); width: 605px;">
40 <tbody >
41 <tr >
42 <td id="web8ffa62b5-7258-42cc-ba53-7ae69638c1fe-img" align="center" class="web-img-wrap" style="word-break: break-word; padding: 15px 50px;"><a href="#" target="_blank" style="border: none; text-decoration: none;"><img border="0" tabindex="0" src="' . YAYMAIL_PLUGIN_URL . 'assets/dist/images/woocommerce-logo.png" class="web-img" width="172" height="auto"></a></td>
43 </tr>
44 </tbody>
45 </table>
46 <table width="605px" cellspacing="0" cellpadding="0" border="0" align="center" id="web802bfe24-7af8-48af-ac5e-6560a81345b3" class="web-main-row" style="display: table; background-color: #96588a; width: 605px;">
47 <tbody >
48 <tr >
49 <td id="web802bfe24-7af8-48af-ac5e-6560a81345b3-shipping-address" align="left" class="web-shipping-address" style="font-size: 13px; line-height: 22px; word-break: break-word; font-family: Helvetica, Roboto, Arial, sans-serif; padding: 36px 48px;">
50 <div >
51 <h1 style="font-size: 30px; font-weight: 300; line-height: normal; margin: 0; color: #fff;">' . $emailTitle . ' [yaymail_order_id]</h1>
52 </div>
53 </td>
54 </tr>
55 </tbody>
56 </table>
57 <table width="605px" cellspacing="0" cellpadding="0" border="0" align="center" id="webb035d1f1-0cfe-41c5-b79c-0478f144ef5f" class="web-main-row" style="display: table; background-color: rgb(255, 255, 255); width: 605px;">
58 <tbody >
59 <tr >
60 <td id="webb035d1f1-0cfe-41c5-b79c-0478f144ef5f-shipping-address" align="left" class="web-shipping-address" style="font-size: 13px; line-height: 22px; word-break: break-word; font-family: Helvetica, Roboto, Arial, sans-serif; padding: 47px 50px 0px;">
61 <div >
62 <p style="margin: 0 0 16px"><span style="color: #636363; font-size: 14px;">' . $emailHi . '</span></p>
63 <p style="margin: 0 0 16px"><span style="color: #636363; font-size: 14px;">' . $emailtext . '</span></p>
64 </div>
65 </td>
66 </tr>
67 </tbody>
68 </table>
69 <table width="605px" cellspacing="0" cellpadding="0" border="0" align="center" id="webad422370-f762-4a26-92de-c4cf3821b8eb" class="web-main-row" style="display: table; background-color: rgb(255, 255, 255); width: 605px;">
70 <tbody >
71 <tr >
72 <td id="web-ad422370-f762-4a26-92de-c4cf3821b8eb-order-item" align="left" class="web-order-item" style="font-size: 13px; line-height: 22px; word-break: break-word; font-family: Helvetica, Roboto, Arial, sans-serif; padding: 2px 50px 15px;">
73 <div class="yaymail_items_border_default" style="color: rgb(99, 99, 99);border-color: #e5e5e5;">
74 <p></p>
75 [yaymail_items_border]
76 <p></p>
77 </div>
78 </td>
79 </tr>
80 </tbody>
81 </table>';
82 if ( class_exists( 'WC_Subscription' ) ) {
83 $html .= '<table width="605px" cellspacing="0" cellpadding="0" border="0" align="center" id="weso422370-f762-4a26-92de-c4cf3821b8eb" class="web-main-row" style="display: table; background-color: rgb(255, 255, 255); width: 605px;">
84 <tbody>
85 <tr>
86 <td id="web-so422370-f762-4a26-92de-c4cf3821b8eb-order-item" align="left" class="web-order-item" style="font-size: 13px; line-height: 22px; word-break: break-word; font-family: Helvetica, Roboto, Arial, sans-serif; padding: 15px 50px;">
87 <div style="color: rgb(99, 99, 99);border-color: #e5e5e5;">
88 <p></p>
89 [yaymail_items_subscription_information]
90 <p></p>
91 </div>
92 </td>
93 </tr>
94 </tbody>
95 </table>';
96 }
97 $html .= '<table width="605px" cellspacing="0" cellpadding="0" border="0" align="center" id="webf0a42dc3-af51-4452-a9e6-a640ea8829b0" class="web-main-row" style="display: table; background-color: rgb(255, 255, 255); width: 605px;">
98 <tbody >
99 <tr >
100 <td id="web-f0a42dc3-af51-4452-a9e6-a640ea8829b0-billing-address" align="left" class="web-billing-address" style="font-size: 13px; line-height: 22px; word-break: break-word; font-family: Helvetica, Roboto, Arial, sans-serif; padding: 12px 50px 15px;">
101 <div style="color: rgb(99, 99, 99);">
102 <p></p>
103 [yaymail_billing_shipping_address]
104 <p></p>
105 </div>
106 </td>
107 </tr>
108 </tbody>
109 </table>
110 <table width="605px" cellspacing="0" cellpadding="0" border="0" align="center" id="webb39bf2e6-8c1a-4384-a5ec-37663da27c8d" class="web-main-row" style="display: table; background-color: rgb(255, 255, 255); width: 605px;">
111 <tbody >
112 <tr >
113 <td id="webb39bf2e6-8c1a-4384-a5ec-37663da27c8d-shipping-address" align="left" class="web-shipping-address" style="font-size: 13px; line-height: 22px; word-break: break-word; font-family: Helvetica, Roboto, Arial, sans-serif; padding-bottom: 38px; padding-right: 50px; padding-left: 50px;">
114 <div >
115 <p><span style="font-size: 14px; color: #636363;">' . $additionalContent . '</span></p>
116 </div>
117 </td>
118 </tr>
119 </tbody>
120 </table>
121 <table width="605px" cellspacing="0" cellpadding="0" border="0" align="center" id="webd6499e3d-d25e-48aa-8130-916bd4773208" class="web-main-row" style="display: table; background-color: rgb(236, 236, 236); width: 605px;">
122 <tbody >
123 <tr >
124 <td id="webd6499e3d-d25e-48aa-8130-916bd4773208-shipping-address" align="left" class="web-shipping-address" style="font-size: 13px; line-height: 22px; word-break: break-word; font-family: Verdana, Geneva, sans-serif; padding: 15px 50px;">
125 <div >
126 <p style="font-size: 14px; color: #8a8a8a; margin: 0px 0px 16px; text-align: center;">[yaymail_site_name] - Built with <a style="color: #96588a; font-weight: normal; text-decoration: underline;" href="https://woocommerce.com" target="_blank" rel="noopener" draggable="false">WooCommerce</a></p>
127 </div>
128 </td>
129 </tr>
130 </tbody>
131 </table>
132 </body>
133 </html>
134 ';
135
136 /*
137 @@@ Elements default when reset template.
138 @@@ Note 1: Add characters '\' before special characters in a string.
139 @@@ example 1: "family": "\'Helvetica Neue\',Helvetica,Roboto,Arial,sans-serif",
140
141 @@@ Note 2: Add characters '\' before special characters in a string.
142 @@@ example 2: "<h1 style=\"font-family: \'Helvetica Neue\',...."
143 */
144
145 // Elements
146 $elements =
147 '[{
148 "id": "8ffa62b5-7258-42cc-ba53-7ae69638c1fe",
149 "type": "Logo",
150 "nameElement": "Logo",
151 "settingRow": {
152 "backgroundColor": "#ECECEC",
153 "align": "center",
154 "pathImg": "",
155 "paddingTop": "15",
156 "paddingRight": "50",
157 "paddingBottom": "15",
158 "paddingLeft": "50",
159 "width": "172",
160 "url": "#"
161 }
162 }, {
163 "id": "802bfe24-7af8-48af-ac5e-6560a81345b3",
164 "type": "ElementText",
165 "nameElement": "Email Heading",
166 "settingRow": {
167 "content": "<h1 style=\"font-size: 30px; font-weight: 300; line-height: normal; margin: 0; color: inherit;\">' . $emailTitle . ' [yaymail_order_id]</h1>",
168 "backgroundColor": "#96588A",
169 "textColor": "#ffffff",
170 "family": "Helvetica,Roboto,Arial,sans-serif",
171 "paddingTop": "36",
172 "paddingRight": "48",
173 "paddingBottom": "36",
174 "paddingLeft": "48"
175 }
176 }, {
177 "id": "b035d1f1-0cfe-41c5-b79c-0478f144ef5f",
178 "type": "ElementText",
179 "nameElement": "Text",
180 "settingRow": {
181 "content": "<p style=\"margin: 0px;\"><span style=\"font-size: 14px;\">' . $emailHi . '<br /><br /></span></p>\n<p style=\"margin: 0px;\"><span style=\"font-size: 14px;\">' . $emailtext . '</span></p>",
182 "backgroundColor": "#fff",
183 "textColor": "#636363",
184 "family": "Helvetica,Roboto,Arial,sans-serif",
185 "paddingTop": "47",
186 "paddingRight": "50",
187 "paddingBottom": "0",
188 "paddingLeft": "50"
189 }
190 },
191 {
192 "id": "ad422370-f762-4a26-92de-c4cf3878h0oi",
193 "type": "OrderItem",
194 "nameElement": "Order Item",
195 "settingRow": {
196 "contentBefore": "[yaymail_items_border_before]",
197 "contentAfter": "[yaymail_items_border_after]",
198 "contentTitle": "[yaymail_items_border_title]",
199 "content": "[yaymail_items_border_content]",
200 "backgroundColor": "#fff",
201 "titleColor" : "#96588a",
202 "textColor": "#636363",
203 "borderColor": "#e5e5e5",
204 "family": "Helvetica,Roboto,Arial,sans-serif",
205 "paddingTop": "15",
206 "paddingRight": "50",
207 "paddingBottom": "15",
208 "paddingLeft": "50"
209 }
210 },';
211 if ( class_exists( 'WC_Subscription' ) ) {
212 $elements .= '{
213 "id": "os422370-f762-4a26-92de-c4cf3878h0oi",
214 "type": "OrderSubscription",
215 "nameElement": "Order Subscription",
216 "settingRow": {
217 "content" : "[yaymail_items_subscription_information]",
218 "backgroundColor" : "#fff",
219 "titleColor" : "#96588a",
220 "textColor" : "#636363",
221 "borderColor" : "#e5e5e5",
222 "family" : "Helvetica,Roboto,Arial,sans-serif",
223 "paddingTop" : "15",
224 "paddingRight" : "50",
225 "paddingBottom" : "15",
226 "paddingLeft" : "50"
227 }
228 },';
229 }
230 $elements .= '{
231 "id": "de242956-a617-4213-9107-138842oi4tch",
232 "type": "BillingAddress",
233 "nameElement": "Billing Shipping Address",
234 "settingRow": {
235 "nameColumn": "BillingShippingAddress",
236 "contentTitle": "[yaymail_billing_shipping_address_title]",
237 "checkBillingShipping": "[yaymail_billing_shipping_address_title]",
238 "titleBilling": "' . $textBillingAddress . '",
239 "titleShipping": "' . $textShippingAddress . '",
240 "content": "[yaymail_billing_shipping_address_content]",
241 "titleColor" : "#96588a",
242 "backgroundColor": "#fff",
243 "borderColor": "#e5e5e5",
244 "textColor": "#636363",
245 "family": "Helvetica,Roboto,Arial,sans-serif",
246 "paddingTop": "15",
247 "paddingRight": "50",
248 "paddingBottom": "15",
249 "paddingLeft": "50"
250 }
251 },
252 {
253 "id": "b39bf2e6-8c1a-4384-a5ec-37663da27c8d",
254 "type": "ElementText",
255 "nameElement": "Footer",
256 "settingRow": {
257 "content": "<p><span style=\"font-size: 14px;\">' . $additionalContent . '</span></p>",
258 "backgroundColor": "#fff",
259 "textColor": "#636363",
260 "family": "Helvetica,Roboto,Arial,sans-serif",
261 "paddingTop": "",
262 "paddingRight": "50",
263 "paddingBottom": "38",
264 "paddingLeft": "50"
265 }
266 },
267 {
268 "id": "b39bf2e6-8c1a-4384-a5ec-37663da27c8ds",
269 "type": "ElementText",
270 "nameElement": "Footer",
271 "settingRow": {
272 "content": "<p style=\"font-size: 14px;margin: 0px 0px 16px; text-align: center;\">[yaymail_site_name]&nbsp;- Built with <a style=\"color: #96588a; font-weight: normal; text-decoration: underline;\" href=\"https://woocommerce.com\" target=\"_blank\" rel=\"noopener\">WooCommerce</a></p>",
273 "backgroundColor": "#ececec",
274 "textColor": "#8a8a8a",
275 "family": "Helvetica,Roboto,Arial,sans-serif",
276 "paddingTop": "15",
277 "paddingRight": "50",
278 "paddingBottom": "15",
279 "paddingLeft": "50"
280 }
281 }]';
282
283 // Templates New Order
284 $templates = array(
285 'customer_refunded_order' => array(),
286 );
287
288 $templates['customer_refunded_order']['html'] = $html;
289 $templates['customer_refunded_order']['elements'] = $elements;
290 return $templates;
291 }
292 }
293