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

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

294 lines 13.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 NewOrder {
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 = __( 'New order', 'woocommerce' );
25 $emailtext = esc_html__( 'You\'ve received the following order from ', 'woocommerce' ) . esc_html( do_shortcode( '[yaymail_billing_first_name] [yaymail_billing_last_name]' ) . ':' );
26 $additionalContent = __( 'Congratulations on the sale.', 'woocommerce' );
27 $textShippingAddress = __( 'Shipping Address', 'woocommerce' );
28 $textBillingAddress = __( 'Billing Address', 'woocommerce' );
29
30 // Html
31 $html = '<html>
32 <head>
33 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
34 </head>
35
36 <body style="background: rgb(236, 236, 236); padding: 0;">
37 <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;">
38 <tbody>
39 <tr>
40 <td id="web8ffa62b5-7258-42cc-ba53-7ae69638c1fe-img" align="center" class="web-img-wrap" style="word-break: break-word; padding: 15px 50px;">
41 <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>
42 </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: 41px 48px;">
50 <div>
51 <h1 style="font-size: 30px; font-weight: 300; line-height: normal; margin: 0px; color: #ffffff;">' . $emailTitle . ': #[yaymail_order_id]</h1></div>
52 </td>
53 </tr>
54 </tbody>
55 </table>
56 <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;">
57 <tbody>
58 <tr>
59 <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;">
60 <div>
61 <p style="margin: 0px;"><span style="color: #636363; font-size: 14px;">' . $emailtext . '</span></p>
62 </div>
63 </td>
64 </tr>
65 </tbody>
66 </table>
67 <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;">
68 <tbody>
69 <tr>
70 <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;">
71 <div style="color: rgb(99, 99, 99);border-color: #e5e5e5;">
72 <p></p>
73 [yaymail_items_border]
74 <p></p>
75 </div>
76 </td>
77 </tr>
78 </tbody>
79 </table>';
80 if ( class_exists( 'WC_Subscription' ) ) {
81 $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;">
82 <tbody>
83 <tr>
84 <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;">
85 <div style="color: rgb(99, 99, 99);border-color: #e5e5e5;">
86 <p></p>
87 [yaymail_items_subscription_information]
88 <p></p>
89 </div>
90 </td>
91 </tr>
92 </tbody>
93 </table>';
94 }
95 $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;">
96 <tbody>
97 <tr>
98 <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: 15px 50px;">
99 <div style="color: rgb(99, 99, 99);">
100 <p></p>
101 [yaymail_billing_shipping_address]
102 <p></p>
103 </div>
104 </td>
105 </tr>
106 </tbody>
107 </table>
108 <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;">
109 <tbody>
110 <tr>
111 <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;">
112 <div>
113 <p><span style="font-size: 14px; color: #636363;">' . $additionalContent . '</span></p>
114 </div>
115 </td>
116 </tr>
117 </tbody>
118 </table>
119 <table width="605px" cellspacing="0" cellpadding="0" border="0" align="center" id="web6d8ff001-7ee7-4183-aff3-d05e4b9fb444" class="web-main-row" style="display: table; background-color: rgb(236, 236, 236); width: 605px;">
120 <tbody>
121 <tr>
122 <td id="web6d8ff001-7ee7-4183-aff3-d05e4b9fb444-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;">
123 <div>
124 <p style="font-size: 14px; color: #8a8a8a; 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>
125 </div>
126 </td>
127 </tr>
128 </tbody>
129 </table>
130 </body>
131 </html>';
132
133 /*
134 @@@ Elements default when reset template.
135 @@@ Note 1: Add characters '\' before special characters in a string.
136 @@@ example 1: "family": "\'Helvetica Neue\',Helvetica,Roboto,Arial,sans-serif",
137
138 @@@ Note 2: Add characters '\' before special characters in a string.
139 @@@ example 2: "<h1 style=\"font-family: \'Helvetica Neue\',...."
140 */
141
142 // Elements
143 $elements_tt = '[{
144 "id": "13031996-7258-42cc-ba53-7ae69638c1fe",
145 "type": "Text",
146 }]';
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: 0px; color: inherit;\">' . $emailTitle . ': #[yaymail_order_id]</h1>",
169 "backgroundColor": "#96588A",
170 "textColor": "#ffffff",
171 "family": "Helvetica,Roboto,Arial,sans-serif",
172 "paddingTop": "41",
173 "paddingRight": "48",
174 "paddingBottom": "41",
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": "32",
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": "0",
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 New Order
285 $templates = array(
286 'new_order' => array(),
287 );
288
289 $templates['new_order']['html'] = $html;
290 $templates['new_order']['elements'] = $elements;
291 return $templates;
292 }
293 }
294