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

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

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