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

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

304 lines 14.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace YayMail\Templates\DefaultTemplate;
4
5 defined( 'ABSPATH' ) || exit;
6
7 class CustomOrderStastus {
8
9 protected static $instance = null;
10
11 public static function getInstance() {
12 if ( null == self::$instance ) {
13 self::$instance = new self();
14 }
15
16 return self::$instance;
17 }
18
19 public static function getTemplates( $customOrder, $emailHeading ) {
20 /*
21 @@@ Html default send email.
22 @@@ Note: Add characters '\' before special characters in a string.
23 @@@ Example: font-family: \'Helvetica Neue\'...
24 */
25
26 $emailTitle = __( $emailHeading, 'woocommerce' );
27 $emailtext = esc_html__( 'Notification to let you know &mdash; order #', 'woocommerce' ) . esc_html( do_shortcode( '[yaymail_order_id]' ) ) . esc_html__( ' belonging to ', 'woocommerce' ) . esc_html( do_shortcode( '[yaymail_billing_first_name] [yaymail_billing_last_name]' ) );
28 $additionalContent = __( 'Thanks for reading.', 'woocommerce' );
29 if ( 'new_renewal_order' == $customOrder ) {
30 $emailtext = esc_html__( 'You have received a subscription renewal order from ', 'woocommerce' ) . esc_html( do_shortcode( '[yaymail_billing_first_name] [yaymail_billing_last_name]' ) ) . esc_html__( ' . Their order is as follows:', 'woocommerce' );
31 $additionalContent = __( 'Congratulations on the sale.', 'woocommerce' );
32 }
33 if ( 'customer_processing_renewal_order' == $customOrder ) {
34 $emailtext = esc_html__( 'Hi ', 'woocommerce' ) . esc_html( do_shortcode( '[yaymail_billing_first_name]' ) . ', <br /><br/>' ) . esc_html__( 'Just to let you know &mdash; we\'ve received your subscription renewal order #', 'woocommerce' ) . esc_html( do_shortcode( '[yaymail_order_id]' ) ) . esc_html__( ', and it is now being processed:', 'woocommerce' );
35 $additionalContent = __( 'Thanks for using ', 'woocommerce' ) . esc_html( do_shortcode( '[yaymail_domain]' ) . '!' );
36 }
37 if ( 'customer_completed_renewal_order' == $customOrder ) {
38 $emailtext = esc_html__( 'Hi ', 'woocommerce' ) . esc_html( do_shortcode( '[yaymail_billing_first_name]' ) . ', <br /><br/>' ) . esc_html__( 'We have finished processing your subscription renewal order.', 'woocommerce' );
39 $additionalContent = __( 'Thanks for shopping with us.', 'woocommerce' );
40 }
41 if ( 'customer_on_hold_renewal_order' == $customOrder ) {
42 $emailtext = esc_html__( 'Hi ', 'woocommerce' ) . esc_html( do_shortcode( '[yaymail_billing_first_name]' ) . ', <br /><br/>' ) . esc_html__( 'Thanks for your renewal order. It\'s on-hold until we confirm that payment has been received. In the meantime, here\'s a reminder of your order:', 'woocommerce' );
43 $additionalContent = __( 'We look forward to fulfilling your order soon.', 'woocommerce' );
44 }
45 if ( 'customer_renewal_invoice' == $customOrder ) {
46 $emailtext = esc_html__( 'Hi ', 'woocommerce' ) . esc_html( do_shortcode( '[yaymail_billing_first_name]' ) . ', <br /><br/>' );
47 $additionalContent = __( 'Thanks for using ', 'woocommerce' ) . esc_html( do_shortcode( '[yaymail_domain]' ) . '!' );
48 }
49
50 $textShippingAddress = __( 'Shipping Address', 'woocommerce' );
51 $textBillingAddress = __( 'Billing Address', 'woocommerce' );
52
53 // Html
54 $html = '<html>
55 <head>
56 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
57 </head>
58
59 <body style="background: rgb(236, 236, 236); padding: 0;">
60 <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;">
61 <tbody>
62 <tr>
63 <td id="web8ffa62b5-7258-42cc-ba53-7ae69638c1fe-img" align="center" class="web-img-wrap" style="word-break: break-word; padding: 15px 50px;">
64 <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>
65 </td>
66 </tr>
67 </tbody>
68 </table>
69 <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;">
70 <tbody>
71 <tr>
72 <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: 41px 48px;">
73 <div>
74 <h1 style="font-size: 30px; font-weight: 300; line-height: normal; margin: 0; color: #fff;">' . $emailTitle;
75 if ( 'new_renewal_order' != $customOrder && 'customer_processing_renewal_order' != $customOrder && 'customer_completed_renewal_order' != $customOrder && 'customer_on_hold_renewal_order' != $customOrder ) {
76 $html .= '#[yaymail_order_id]';
77 }
78 $html .= '</h1></div>
79 </td>
80 </tr>
81 </tbody>
82 </table>
83 <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;">
84 <tbody>
85 <tr>
86 <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: 32px 50px 0px;">
87 <div>
88 <p style="margin: 0px;"><span style="color: #636363; font-size: 14px;">' . $emailtext . '</span></p>
89 </div>
90 </td>
91 </tr>
92 </tbody>
93 </table>
94 <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;">
95 <tbody>
96 <tr>
97 <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: 15px 50px;">
98 <div style="color: rgb(99, 99, 99);border-color: #e5e5e5;">
99 <p></p>
100 [yaymail_items_border]
101 <p></p>
102 </div>
103 </td>
104 </tr>
105 </tbody>
106 </table>
107 <table width="605px" cellspacing="0" cellpadding="0" border="0" align="center" id="webde242956-a617-4213-9107-138842cc6bff" class="web-main-row" style="display: table; background-color: rgb(255, 255, 255); width: 605px;">
108 <tbody>
109 <tr>
110 <td id="web-de242956-a617-4213-9107-138842cc6bff-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: 15px 50px;">
111 <div style="color: rgb(99, 99, 99);">
112 <p>
113 [yaymail_billing_shipping_address]
114 </p>
115 </div>
116 </td>
117 </tr>
118 </tbody>
119 </table>
120 <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;">
121 <tbody>
122 <tr>
123 <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-top: 16px; padding-bottom: 50px; padding-right: 50px; padding-left: 50px;">
124 <div>
125 <p><span style="font-size: 14px; color: #636363;">' . $additionalContent . '</span></p>
126 </div>
127 </td>
128 </tr>
129 </tbody>
130 </table>
131 <table width="605px" cellspacing="0" cellpadding="0" border="0" align="center" id="webd50a08d5-e35f-41f7-951c-22b5c51fbadb" class="web-main-row" style="display: table; background-color: rgb(236, 236, 236); width: 605px;">
132 <tbody>
133 <tr>
134 <td id="webd50a08d5-e35f-41f7-951c-22b5c51fbadb-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;">
135 <div>
136 <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>
137 </div>
138 </td>
139 </tr>
140 </tbody>
141 </table>
142 </body>
143
144 </html>';
145
146 /*
147 @@@ Elements default when reset template.
148 @@@ Note 1: Add characters '\' before special characters in a string.
149 @@@ example 1: "family": "\'Helvetica Neue\',Helvetica,Roboto,Arial,sans-serif",
150
151 @@@ Note 2: Add characters '\' before special characters in a string.
152 @@@ example 2: "<h1 style=\"font-family: \'Helvetica Neue\',...."
153 */
154
155 // Elements
156 $elements =
157 '[{
158 "id": "8ffa62b5-7258-42cc-ba53-7ae69638c1fe",
159 "type": "Logo",
160 "nameElement": "Logo",
161 "settingRow": {
162 "backgroundColor": "#ECECEC",
163 "align": "center",
164 "pathImg": "",
165 "paddingTop": "15",
166 "paddingRight": "50",
167 "paddingBottom": "15",
168 "paddingLeft": "50",
169 "width": "172",
170 "url": "#"
171 }
172 },';
173 if ( 'new_renewal_order' != $customOrder && 'customer_processing_renewal_order' != $customOrder && 'customer_completed_renewal_order' != $customOrder && 'customer_on_hold_renewal_order' != $customOrder ) {
174 $elements .= '{
175 "id": "802bfe24-7af8-48af-ac5e-6560a81345b3",
176 "type": "ElementText",
177 "nameElement": "Email Heading",
178 "settingRow": {
179 "content": "<h1 style=\"font-size: 30px; font-weight: 300; line-height: normal; margin: 0; color: inherit;\">' . $emailTitle . ' #[yaymail_order_id]</h1>",
180 "backgroundColor": "#96588A",
181 "textColor": "#ffffff",
182 "family": "Helvetica,Roboto,Arial,sans-serif",
183 "paddingTop": "36",
184 "paddingRight": "48",
185 "paddingBottom": "36",
186 "paddingLeft": "48"
187 }
188 },';
189 } else {
190 $elements .= '{
191 "id": "802bfe24-7af8-48af-ac5e-6560a81345b3",
192 "type": "ElementText",
193 "nameElement": "Email Heading",
194 "settingRow": {
195 "content": "<h1 style=\"font-size: 30px; font-weight: 300; line-height: normal; margin: 0; color: inherit;\">' . $emailTitle . '</h1>",
196 "backgroundColor": "#96588A",
197 "textColor": "#ffffff",
198 "family": "Helvetica,Roboto,Arial,sans-serif",
199 "paddingTop": "36",
200 "paddingRight": "48",
201 "paddingBottom": "36",
202 "paddingLeft": "48"
203 }
204 },';
205 }
206 $elements .= '{
207 "id": "b035d1f1-0cfe-41c5-b79c-0478f144ef5f",
208 "type": "ElementText",
209 "nameElement": "Text",
210 "settingRow": {
211 "content": "<p style=\"margin: 0px;\"><span style=\"font-size: 14px;\">' . $emailtext . '</span></p>",
212 "backgroundColor": "#fff",
213 "textColor": "#636363",
214 "family": "Helvetica,Roboto,Arial,sans-serif",
215 "paddingTop": "47",
216 "paddingRight": "50",
217 "paddingBottom": "0",
218 "paddingLeft": "50"
219 }
220 },
221 {
222 "id": "ad422370-f762-4a26-92de-c4cf3878h0oi",
223 "type": "OrderItem",
224 "nameElement": "Order Item",
225 "settingRow": {
226 "contentBefore": "[yaymail_items_border_before]",
227 "contentAfter": "[yaymail_items_border_after]",
228 "contentTitle": "[yaymail_items_border_title]",
229 "content": "[yaymail_items_border_content]",
230 "backgroundColor": "#fff",
231 "titleColor" : "#96588a",
232 "textColor": "#636363",
233 "borderColor": "#e5e5e5",
234 "family": "Helvetica,Roboto,Arial,sans-serif",
235 "paddingTop": "15",
236 "paddingRight": "50",
237 "paddingBottom": "15",
238 "paddingLeft": "50"
239 }
240 },
241 {
242 "id": "de242956-a617-4213-9107-138842oi4tch",
243 "type": "BillingAddress",
244 "nameElement": "Billing Shipping Address",
245 "settingRow": {
246 "nameColumn": "BillingShippingAddress",
247 "contentTitle": "[yaymail_billing_shipping_address_title]",
248 "checkBillingShipping": "[yaymail_billing_shipping_address_title]",
249 "titleBilling": "' . $textBillingAddress . '",
250 "titleShipping": "' . $textShippingAddress . '",
251 "content": "[yaymail_billing_shipping_address_content]",
252 "titleColor" : "#96588a",
253 "backgroundColor": "#fff",
254 "borderColor": "#e5e5e5",
255 "textColor": "#636363",
256 "family": "Helvetica,Roboto,Arial,sans-serif",
257 "paddingTop": "15",
258 "paddingRight": "50",
259 "paddingBottom": "15",
260 "paddingLeft": "50"
261 }
262 },
263 {
264 "id": "b39bf2e6-8c1a-4384-a5ec-37663da27c8d",
265 "type": "ElementText",
266 "nameElement": "Footer",
267 "settingRow": {
268 "content": "<p><span style=\"font-size: 14px;\">' . $additionalContent . '</span></p>",
269 "backgroundColor": "#fff",
270 "textColor": "#636363",
271 "family": "Helvetica,Roboto,Arial,sans-serif",
272 "paddingTop": "",
273 "paddingRight": "50",
274 "paddingBottom": "38",
275 "paddingLeft": "50"
276 }
277 },
278 {
279 "id": "b39bf2e6-8c1a-4384-a5ec-37663da27c8ds",
280 "type": "ElementText",
281 "nameElement": "Footer",
282 "settingRow": {
283 "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>",
284 "backgroundColor": "#ececec",
285 "textColor": "#8a8a8a",
286 "family": "Helvetica,Roboto,Arial,sans-serif",
287 "paddingTop": "15",
288 "paddingRight": "50",
289 "paddingBottom": "15",
290 "paddingLeft": "50"
291 }
292 }]';
293
294 // Templates Cancelled Order
295 $templates = array(
296 $customOrder => array(),
297 );
298
299 $templates[ $customOrder ]['html'] = $html;
300 $templates[ $customOrder ]['elements'] = $elements;
301 return $templates;
302 }
303 }
304