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

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

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