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

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

291 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 FailedOrder {
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 Failed: #{order_number}', 'woocommerce' );
25 $emailTitle = str_replace( '#{order_number}', '', $emailTitle );
26 $emailtext = esc_html__( 'Payment for order #', 'woocommerce' ) . esc_html( do_shortcode( '[yaymail_order_id]' ) ) . esc_html__( ' from ', 'woocommerce' ) . esc_html( do_shortcode( '[yaymail_billing_first_name] [yaymail_billing_last_name]' ) ) . esc_html__( ' has failed. The order was as follows:', 'woocommerce' );
27 $additionalContent = __( 'Hopefully they\'ll be back. Read more about <a href=\"https://docs.woocommerce.com/document/managing-orders/\">troubleshooting failed payments</a>.', 'woocommerce' );
28 $additionalContent = str_replace( '<a', '<a style=\"color: #96588a;\"', $additionalContent );
29 $textShippingAddress = __( 'Shipping Address', 'woocommerce' );
30 $textBillingAddress = __( 'Billing Address', 'woocommerce' );
31
32 // Html
33 $html = '<html>
34 <head>
35 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
36 </head>
37
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;">
43 <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>
44 </td>
45 </tr>
46 </tbody>
47 </table>
48 <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;">
49 <tbody>
50 <tr>
51 <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;">
52 <div>
53 <h1 style="font-size: 30px; font-weight: 300; line-height: normal; margin: 0; color: #fff;">' . $emailTitle . ' #[yaymail_order_id]</h1></div>
54 </td>
55 </tr>
56 </tbody>
57 </table>
58 <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;">
59 <tbody>
60 <tr>
61 <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;">
62 <div>
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 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="web0fdff7fe-4390-4504-8611-299c6c05cfa6" class="web-main-row" style="display: table; background-color: rgb(255, 255, 255); width: 605px;">
98 <tbody>
99 <tr>
100 <td id="web-0fdff7fe-4390-4504-8611-299c6c05cfa6-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>
103 [yaymail_billing_shipping_address]
104 </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="webdff795d0-6d11-43a7-8896-c84a2a5b7c98" class="web-main-row" style="display: table; background-color: rgb(236, 236, 236); width: 605px;">
122 <tbody>
123 <tr>
124 <td id="webdff795d0-6d11-43a7-8896-c84a2a5b7c98-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 @@@ Elements default when reset template.
137 @@@ Note 1: Add characters '\' before special characters in a string.
138 @@@ example 1: "family": "\'Helvetica Neue\',Helvetica,Roboto,Arial,sans-serif",
139
140 @@@ Note 2: Add characters '\' before special characters in a string.
141 @@@ example 2: "<h1 style=\"font-family: \'Helvetica Neue\',...."
142 */
143 // Elements
144 $elements =
145 '[{
146 "id": "8ffa62b5-7258-42cc-ba53-7ae69638c1fe",
147 "type": "Logo",
148 "nameElement": "Logo",
149 "settingRow": {
150 "backgroundColor": "#ECECEC",
151 "align": "center",
152 "pathImg": "",
153 "paddingTop": "15",
154 "paddingRight": "50",
155 "paddingBottom": "15",
156 "paddingLeft": "50",
157 "width": "172",
158 "url": "#"
159 }
160 }, {
161 "id": "802bfe24-7af8-48af-ac5e-6560a81345b3",
162 "type": "ElementText",
163 "nameElement": "Email Heading",
164 "settingRow": {
165 "content": "<h1 style=\"font-size: 30px; font-weight: 300; line-height: normal; margin: 0; color: inherit;\">' . $emailTitle . ' #[yaymail_order_id]</h1>",
166 "backgroundColor": "#96588A",
167 "textColor": "#ffffff",
168 "family": "Helvetica,Roboto,Arial,sans-serif",
169 "paddingTop": "36",
170 "paddingRight": "48",
171 "paddingBottom": "36",
172 "paddingLeft": "48"
173 }
174 }, {
175 "id": "b035d1f1-0cfe-41c5-b79c-0478f144ef5f",
176 "type": "ElementText",
177 "nameElement": "Text",
178 "settingRow": {
179 "content": "<p style=\"margin: 0px;\"><span style=\"font-size: 14px;\">' . $emailtext . '</span></p>",
180 "backgroundColor": "#fff",
181 "textColor": "#636363",
182 "family": "Helvetica,Roboto,Arial,sans-serif",
183 "paddingTop": "47",
184 "paddingRight": "50",
185 "paddingBottom": "0",
186 "paddingLeft": "50"
187 }
188 },
189 {
190 "id": "ad422370-f762-4a26-92de-c4cf3878h0oi",
191 "type": "OrderItem",
192 "nameElement": "Order Item",
193 "settingRow": {
194 "contentBefore": "[yaymail_items_border_before]",
195 "contentAfter": "[yaymail_items_border_after]",
196 "contentTitle": "[yaymail_items_border_title]",
197 "content": "[yaymail_items_border_content]",
198 "backgroundColor": "#fff",
199 "titleColor" : "#96588a",
200 "textColor": "#636363",
201 "borderColor": "#e5e5e5",
202 "family": "Helvetica,Roboto,Arial,sans-serif",
203 "paddingTop": "15",
204 "paddingRight": "50",
205 "paddingBottom": "15",
206 "paddingLeft": "50"
207 }
208 },';
209 if ( class_exists( 'WC_Subscription' ) ) {
210 $elements .= '{
211 "id": "os422370-f762-4a26-92de-c4cf3878h0oi",
212 "type": "OrderSubscription",
213 "nameElement": "Order Subscription",
214 "settingRow": {
215 "content" : "[yaymail_items_subscription_information]",
216 "backgroundColor" : "#fff",
217 "titleColor" : "#96588a",
218 "textColor" : "#636363",
219 "borderColor" : "#e5e5e5",
220 "family" : "Helvetica,Roboto,Arial,sans-serif",
221 "paddingTop" : "15",
222 "paddingRight" : "50",
223 "paddingBottom" : "15",
224 "paddingLeft" : "50"
225 }
226 },';
227 }
228 $elements .= '{
229 "id": "de242956-a617-4213-9107-138842oi4tch",
230 "type": "BillingAddress",
231 "nameElement": "Billing Shipping Address",
232 "settingRow": {
233 "nameColumn": "BillingShippingAddress",
234 "contentTitle": "[yaymail_billing_shipping_address_title]",
235 "checkBillingShipping": "[yaymail_billing_shipping_address_title]",
236 "titleBilling": "' . $textBillingAddress . '",
237 "titleShipping": "' . $textShippingAddress . '",
238 "content": "[yaymail_billing_shipping_address_content]",
239 "titleColor" : "#96588a",
240 "backgroundColor": "#fff",
241 "borderColor": "#e5e5e5",
242 "textColor": "#636363",
243 "family": "Helvetica,Roboto,Arial,sans-serif",
244 "paddingTop": "15",
245 "paddingRight": "50",
246 "paddingBottom": "15",
247 "paddingLeft": "50"
248 }
249 },
250 {
251 "id": "b39bf2e6-8c1a-4384-a5ec-37663da27c8d",
252 "type": "ElementText",
253 "nameElement": "Footer",
254 "settingRow": {
255 "content": "<p><span style=\"font-size: 14px\">' . $additionalContent . '</span></p>",
256 "backgroundColor": "#fff",
257 "textColor": "#636363",
258 "family": "Helvetica,Roboto,Arial,sans-serif",
259 "paddingTop": "",
260 "paddingRight": "50",
261 "paddingBottom": "38",
262 "paddingLeft": "50"
263 }
264 },
265 {
266 "id": "b39bf2e6-8c1a-4384-a5ec-37663da27c8ds",
267 "type": "ElementText",
268 "nameElement": "Footer",
269 "settingRow": {
270 "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>",
271 "backgroundColor": "#ececec",
272 "textColor": "#8a8a8a",
273 "family": "Helvetica,Roboto,Arial,sans-serif",
274 "paddingTop": "15",
275 "paddingRight": "50",
276 "paddingBottom": "15",
277 "paddingLeft": "50"
278 }
279 }]';
280
281 // Templates New Order
282 $templates = array(
283 'failed_order' => array(),
284 );
285
286 $templates['failed_order']['html'] = $html;
287 $templates['failed_order']['elements'] = $elements;
288 return $templates;
289 }
290 }
291