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 / CustomerCompletedOrder.php

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

324 lines 15.7 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 CustomerCompletedOrder {
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 = __( 'Thanks for shopping with us', 'woocommerce' );
25 $emailHi = esc_html__( 'Hi ', 'woocommerce' ) . esc_html( do_shortcode( '[yaymail_billing_first_name]' ) . ',' );
26 $emailtext = esc_html__( 'We have finished processing your order.', 'woocommerce' );
27 $additionalContent = __( 'Thanks for shopping with us.', 'woocommerce' );
28 $textShippingAddress = __( 'Shipping Address', 'woocommerce' );
29 $textBillingAddress = __( 'Billing Address', 'woocommerce' );
30
31 // Html
32 $html = '
33 <html>
34 <head>
35 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
36 </head>
37 <body style="background: rgb(236, 236, 236); padding: 0;">
38 <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;">
39 <tbody >
40 <tr >
41 <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>
42 </tr>
43 </tbody>
44 </table>
45 <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;">
46 <tbody >
47 <tr >
48 <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;">
49 <div >
50 <h1 style="font-size: 30px; font-weight: 300; line-height: normal; margin: 0; color: #fff;">' . $emailTitle . '</h1>
51 </div>
52 </td>
53 </tr>
54 </tbody>
55 </table>
56 <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;">
57 <tbody >
58 <tr >
59 <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;">
60 <div >
61 <p style="margin: 0 0 16px;"><span style="color: #636363; font-size: 14px;">' . $emailHi . '</span></p>
62 <p style="margin: 0 0 16px;"><span style="color: #636363; font-size: 14px;">' . $emailtext . '</span></p>
63 </div>
64 </td>
65 </tr>
66 </tbody>
67 </table>
68 <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;">
69 <tbody >
70 <tr >
71 <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;">
72 <div class="yaymail_items_border_default" style="color: rgb(99, 99, 99);">
73 <p></p>
74 [yaymail_items_downloadable_title]
75 [yaymail_items_downloadable_product]
76 <p></p>
77 </div>
78 </td>
79 </tr>
80 </tbody>
81 </table>
82 <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;">
83 <tbody >
84 <tr >
85 <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;">
86 <div class="yaymail_items_border_default" style="color: rgb(99, 99, 99);border-color: #e5e5e5;">
87 <p></p>
88 [yaymail_items_border]
89 <p></p>
90 </div>
91 </td>
92 </tr>
93 </tbody>
94 </table>';
95 if ( class_exists( 'WC_Subscription' ) ) {
96 $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;">
97 <tbody>
98 <tr>
99 <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;">
100 <div style="color: rgb(99, 99, 99);border-color: #e5e5e5;">
101 <p></p>
102 [yaymail_items_subscription_information]
103 <p></p>
104 </div>
105 </td>
106 </tr>
107 </tbody>
108 </table>';
109 }
110 $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;">
111 <tbody >
112 <tr >
113 <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;">
114 <div style="color: rgb(99, 99, 99);">
115 <p></p>
116 [yaymail_billing_shipping_address]
117 <p></p>
118 </div>
119 </td>
120 </tr>
121 </tbody>
122 </table>
123 <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;">
124 <tbody >
125 <tr >
126 <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;">
127 <div >
128 <p><span style="font-size: 14px; color: #636363;">' . $additionalContent . '</span></p>
129 </div>
130 </td>
131 </tr>
132 </tbody>
133 </table>
134 <table width="605px" cellspacing="0" cellpadding="0" border="0" align="center" id="webfcb50432-a636-464d-a2af-97de44811847" class="web-main-row" style="display: table; background-color: rgb(236, 236, 236); width: 605px;">
135 <tbody >
136 <tr >
137 <td id="webfcb50432-a636-464d-a2af-97de44811847-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;">
138 <div >
139 <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">WooCommerce</a></p>
140 </div>
141 </td>
142 </tr>
143 </tbody>
144 </table>
145 </body>
146 </html>
147 ';
148
149 /*
150 @@@ Elements default when reset template.
151 @@@ Note 1: Add characters '\' before special characters in a string.
152 @@@ example 1: "family": "\'Helvetica Neue\',Helvetica,Roboto,Arial,sans-serif",
153
154 @@@ Note 2: Add characters '\' before special characters in a string.
155 @@@ example 2: "<h1 style=\"font-family: \'Helvetica Neue\',...."
156 */
157
158 // Elements
159 $elements =
160 '[{
161 "id": "8ffa62b5-7258-42cc-ba53-7ae69638c1fe",
162 "type": "Logo",
163 "nameElement": "Logo",
164 "settingRow": {
165 "backgroundColor": "#ECECEC",
166 "align": "center",
167 "pathImg": "",
168 "paddingTop": "15",
169 "paddingRight": "50",
170 "paddingBottom": "15",
171 "paddingLeft": "50",
172 "width": "172",
173 "url": "#"
174 }
175 }, {
176 "id": "802bfe24-7af8-48af-ac5e-6560a81345b3",
177 "type": "ElementText",
178 "nameElement": "Email Heading",
179 "settingRow": {
180 "content": "<h1 style=\"font-size: 30px; font-weight: 300; line-height: normal; margin: 0; color: inherit;\">' . $emailTitle . '</h1>",
181 "backgroundColor": "#96588A",
182 "textColor": "#ffffff",
183 "family": "Helvetica,Roboto,Arial,sans-serif",
184 "paddingTop": "36",
185 "paddingRight": "48",
186 "paddingBottom": "36",
187 "paddingLeft": "48"
188 }
189 }, {
190 "id": "b035d1f1-0cfe-41c5-b79c-0478f144ef5f",
191 "type": "ElementText",
192 "nameElement": "Text",
193 "settingRow": {
194 "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>",
195 "backgroundColor": "#fff",
196 "textColor": "#636363",
197 "family": "Helvetica,Roboto,Arial,sans-serif",
198 "paddingTop": "47",
199 "paddingRight": "50",
200 "paddingBottom": "0",
201 "paddingLeft": "50"
202 }
203 },
204 {
205 "id": "ad422370-f762-4a26-92de-c4cf3878h0oirt",
206 "type": "OrderItemDownload",
207 "nameElement": "Order Item Download",
208 "settingRow": {
209 "contentTitle": "[yaymail_items_downloadable_title]",
210 "content": "[yaymail_items_downloadable_product]",
211 "backgroundColor": "#fff",
212 "titleColor" : "#96588a",
213 "textColor": "#636363",
214 "borderColor": "#e5e5e5",
215 "family": "Helvetica,Roboto,Arial,sans-serif",
216 "paddingTop": "0",
217 "paddingRight": "50",
218 "paddingBottom": "0",
219 "paddingLeft": "50"
220 }
221 },
222 {
223 "id": "ad422370-f762-4a26-92de-c4cf3878h0oi",
224 "type": "OrderItem",
225 "nameElement": "Order Item",
226 "settingRow": {
227 "contentBefore": "[yaymail_items_border_before]",
228 "contentAfter": "[yaymail_items_border_after]",
229 "contentTitle": "[yaymail_items_border_title]",
230 "content": "[yaymail_items_border_content]",
231 "backgroundColor": "#fff",
232 "titleColor" : "#96588a",
233 "textColor": "#636363",
234 "borderColor": "#e5e5e5",
235 "family": "Helvetica,Roboto,Arial,sans-serif",
236 "paddingTop": "15",
237 "paddingRight": "50",
238 "paddingBottom": "15",
239 "paddingLeft": "50"
240 }
241 },';
242 if ( class_exists( 'WC_Subscription' ) ) {
243 $elements .= '{
244 "id": "os422370-f762-4a26-92de-c4cf3878h0oi",
245 "type": "OrderSubscription",
246 "nameElement": "Order Subscription",
247 "settingRow": {
248 "content" : "[yaymail_items_subscription_information]",
249 "backgroundColor" : "#fff",
250 "titleColor" : "#96588a",
251 "textColor" : "#636363",
252 "borderColor" : "#e5e5e5",
253 "family" : "Helvetica,Roboto,Arial,sans-serif",
254 "paddingTop" : "15",
255 "paddingRight" : "50",
256 "paddingBottom" : "15",
257 "paddingLeft" : "50"
258 }
259 },';
260 }
261 $elements .= '{
262 "id": "de242956-a617-4213-9107-138842oi4tch",
263 "type": "BillingAddress",
264 "nameElement": "Billing Shipping Address",
265 "settingRow": {
266 "nameColumn": "BillingShippingAddress",
267 "contentTitle": "[yaymail_billing_shipping_address_title]",
268 "checkBillingShipping": "[yaymail_billing_shipping_address_title]",
269 "titleBilling": "' . $textBillingAddress . '",
270 "titleShipping": "' . $textShippingAddress . '",
271 "content": "[yaymail_billing_shipping_address_content]",
272 "titleColor" : "#96588a",
273 "backgroundColor": "#fff",
274 "borderColor": "#e5e5e5",
275 "textColor": "#636363",
276 "family": "Helvetica,Roboto,Arial,sans-serif",
277 "paddingTop": "15",
278 "paddingRight": "50",
279 "paddingBottom": "15",
280 "paddingLeft": "50"
281 }
282 },
283 {
284 "id": "b39bf2e6-8c1a-4384-a5ec-37663da27c8d",
285 "type": "ElementText",
286 "nameElement": "Footer",
287 "settingRow": {
288 "content": "<p><span style=\"font-size: 14px;\">' . $additionalContent . '</span></p>",
289 "backgroundColor": "#fff",
290 "textColor": "#636363",
291 "family": "Helvetica,Roboto,Arial,sans-serif",
292 "paddingTop": "",
293 "paddingRight": "50",
294 "paddingBottom": "38",
295 "paddingLeft": "50"
296 }
297 },
298 {
299 "id": "b39bf2e6-8c1a-4384-a5ec-37663da27c8ds",
300 "type": "ElementText",
301 "nameElement": "Footer",
302 "settingRow": {
303 "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>",
304 "backgroundColor": "#ececec",
305 "textColor": "#8a8a8a",
306 "family": "Helvetica,Roboto,Arial,sans-serif",
307 "paddingTop": "15",
308 "paddingRight": "50",
309 "paddingBottom": "15",
310 "paddingLeft": "50"
311 }
312 }]';
313
314 // Templates New Order
315 $templates = array(
316 'customer_completed_order' => array(),
317 );
318
319 $templates['customer_completed_order']['html'] = $html;
320 $templates['customer_completed_order']['elements'] = $elements;
321 return $templates;
322 }
323 }
324