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

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

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