PluginProbe
YayMail – WooCommerce Email Customizer / 3.2.2
YayMail – WooCommerce Email Customizer v3.2.2
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 3.4.2 3.4.3 All 55 releases
yaymail / includes / Templates / DefaultTemplate / FailedOrder.php

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

194 lines 7.2 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: #7f54b3;\"', $additionalContent );
29 $textShippingAddress = __( 'Shipping Address', 'woocommerce' );
30 $textBillingAddress = __( 'Billing Address', 'woocommerce' );
31
32 /*
33 @@@ Elements default when reset template.
34 @@@ Note 1: Add characters '\' before special characters in a string.
35 @@@ example 1: "family": "\'Helvetica Neue\',Helvetica,Roboto,Arial,sans-serif",
36
37 @@@ Note 2: Add characters '\' before special characters in a string.
38 @@@ example 2: "<h1 style=\"font-family: \'Helvetica Neue\',...."
39 */
40 // Elements
41 $elements =
42 '[{
43 "id": "8ffa62b5-7258-42cc-ba53-7ae69638c1fe",
44 "type": "Logo",
45 "nameElement": "Logo",
46 "settingRow": {
47 "backgroundColor": "#ECECEC",
48 "align": "center",
49 "pathImg": "",
50 "paddingTop": "15",
51 "paddingRight": "0",
52 "paddingBottom": "15",
53 "paddingLeft": "0",
54 "width": "172",
55 "url": "#"
56 }
57 }, {
58 "id": "802bfe24-7af8-48af-ac5e-6560a81345b3",
59 "type": "ElementText",
60 "nameElement": "Email Heading",
61 "settingRow": {
62 "content": "<h1 style=\"font-size: 30px; font-weight: 300; line-height: normal; margin: 0; color: inherit;\">' . $emailTitle . ' #[yaymail_order_id]</h1>",
63 "backgroundColor": "#7f54b3",
64 "textColor": "#ffffff",
65 "family": "Helvetica,Roboto,Arial,sans-serif",
66 "paddingTop": "36",
67 "paddingRight": "48",
68 "paddingBottom": "36",
69 "paddingLeft": "48"
70 }
71 }, {
72 "id": "b035d1f1-0cfe-41c5-b79c-0478f144ef5f",
73 "type": "ElementText",
74 "nameElement": "Text",
75 "settingRow": {
76 "content": "<p style=\"margin: 0px;\"><span style=\"font-size: 14px;\">' . $emailtext . '</span></p>",
77 "backgroundColor": "#fff",
78 "textColor": "#636363",
79 "family": "Helvetica,Roboto,Arial,sans-serif",
80 "paddingTop": "47",
81 "paddingRight": "50",
82 "paddingBottom": "0",
83 "paddingLeft": "50"
84 }
85 },
86 {
87 "id": "ad422370-f762-4a26-92de-c4cf3878h0oi",
88 "type": "OrderItem",
89 "nameElement": "Order Item",
90 "settingRow": {
91 "contentBefore": "[yaymail_items_border_before]",
92 "contentAfter": "[yaymail_items_border_after]",
93 "contentTitle": "[yaymail_items_border_title]",
94 "content": "[yaymail_items_border_content]",
95 "backgroundColor": "#fff",
96 "titleColor" : "#7f54b3",
97 "textColor": "#636363",
98 "borderColor": "#e5e5e5",
99 "family": "Helvetica,Roboto,Arial,sans-serif",
100 "paddingTop": "15",
101 "paddingRight": "50",
102 "paddingBottom": "15",
103 "paddingLeft": "50"
104 }
105 },';
106 if ( class_exists( 'WC_Subscription' ) ) {
107 $elements .= '{
108 "id": "os422370-f762-4a26-92de-c4cf3878h0oi",
109 "type": "AddonWooSubscriptionInformation",
110 "nameElement": "Woo Subscription Information",
111 "settingRow": {
112 "backgroundColor":"#fff",
113 "borderColor":"#e5e5e5",
114 "content":"This is content",
115 "contentAfter":"[yaymail_items_border_after]",
116 "contentBefore":"[yaymail_items_border_before]",
117 "contentTitle":"Subscription information",
118 "family":"Helvetica,Roboto,Arial,sans-serif",
119 "paddingBottom":"15",
120 "paddingLeft":"50",
121 "paddingRight":"50",
122 "paddingTop":"15",
123 "textColor":"#636363",
124 "titleColor":"#7f54b3",
125 "titleID": "ID",
126 "titleStartDate": "Start date",
127 "titleEndDate": "End date",
128 "titleRecurringTotal": "Recurring total"
129 }
130 },';
131 }
132 $elements .= '{
133 "id": "de242956-a617-4213-9107-138842oi4tch",
134 "type": "BillingAddress",
135 "nameElement": "Billing Shipping Address",
136 "settingRow": {
137 "nameColumn": "BillingShippingAddress",
138 "contentTitle": "[yaymail_billing_shipping_address_title]",
139 "checkBillingShipping": "[yaymail_billing_shipping_address_title]",
140 "titleBilling": "' . $textBillingAddress . '",
141 "titleShipping": "' . $textShippingAddress . '",
142 "content": "[yaymail_billing_shipping_address_content]",
143 "titleColor" : "#7f54b3",
144 "backgroundColor": "#fff",
145 "borderColor": "#e5e5e5",
146 "textColor": "#636363",
147 "family": "Helvetica,Roboto,Arial,sans-serif",
148 "paddingTop": "15",
149 "paddingRight": "50",
150 "paddingBottom": "15",
151 "paddingLeft": "50"
152 }
153 },
154 {
155 "id": "b39bf2e6-8c1a-4384-a5ec-37663da27c8d",
156 "type": "ElementText",
157 "nameElement": "Text",
158 "settingRow": {
159 "content": "<p><span style=\"font-size: 14px\">' . $additionalContent . '</span></p>",
160 "backgroundColor": "#fff",
161 "textColor": "#636363",
162 "family": "Helvetica,Roboto,Arial,sans-serif",
163 "paddingTop": "0",
164 "paddingRight": "50",
165 "paddingBottom": "38",
166 "paddingLeft": "50"
167 }
168 },
169 {
170 "id": "b39bf2e6-8c1a-4384-a5ec-37663da27c8ds",
171 "type": "ElementText",
172 "nameElement": "Footer",
173 "settingRow": {
174 "content": "<p style=\"font-size: 14px;margin: 0px 0px 16px; text-align: center;\">[yaymail_site_name]&nbsp;- Built with <a style=\"color: #7f54b3; font-weight: normal; text-decoration: underline;\" href=\"https://woocommerce.com\" target=\"_blank\" rel=\"noopener\">WooCommerce</a></p>",
175 "backgroundColor": "#ececec",
176 "textColor": "#8a8a8a",
177 "family": "Helvetica,Roboto,Arial,sans-serif",
178 "paddingTop": "15",
179 "paddingRight": "50",
180 "paddingBottom": "15",
181 "paddingLeft": "50"
182 }
183 }]';
184
185 // Templates New Order
186 $templates = array(
187 'failed_order' => array(),
188 );
189
190 $templates['failed_order']['elements'] = $elements;
191 return $templates;
192 }
193 }
194