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

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

210 lines 8.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace YayMail\Templates\DefaultTemplate;
4
5 defined( 'ABSPATH' ) || exit;
6
7 class CustomOrderStastus {
8
9 protected static $instance = null;
10
11 public static function getInstance() {
12 if ( null == self::$instance ) {
13 self::$instance = new self();
14 }
15
16 return self::$instance;
17 }
18
19 public static function getTemplates( $customOrder, $emailHeading ) {
20 /*
21 @@@ Html default send email.
22 @@@ Note: Add characters '\' before special characters in a string.
23 @@@ Example: font-family: \'Helvetica Neue\'...
24 */
25
26 $emailTitle = __( $emailHeading, 'woocommerce' );
27 $emailtext = esc_html__( 'Notification to let you know &mdash; order #', 'woocommerce' ) . esc_html( do_shortcode( '[yaymail_order_id]' ) ) . esc_html__( ' belonging to ', 'woocommerce' ) . esc_html( do_shortcode( '[yaymail_billing_first_name] [yaymail_billing_last_name]' ) );
28 $additionalContent = __( 'Thanks for reading.', 'woocommerce' );
29 if ( 'new_renewal_order' == $customOrder ) {
30 $emailtext = esc_html__( 'You have received a subscription renewal order from ', 'woocommerce' ) . esc_html( do_shortcode( '[yaymail_billing_first_name] [yaymail_billing_last_name]' ) ) . esc_html__( ' . Their order is as follows:', 'woocommerce' );
31 $additionalContent = __( 'Congratulations on the sale.', 'woocommerce' );
32 }
33 if ( 'customer_processing_renewal_order' == $customOrder ) {
34 $emailtext = esc_html__( 'Hi ', 'woocommerce' ) . esc_html( do_shortcode( '[yaymail_billing_first_name]' ) . ', <br /><br/>' ) . esc_html__( 'Just to let you know &mdash; we\'ve received your subscription renewal order #', 'woocommerce' ) . esc_html( do_shortcode( '[yaymail_order_id]' ) ) . esc_html__( ', and it is now being processed:', 'woocommerce' );
35 $additionalContent = __( 'Thanks for using ', 'woocommerce' ) . esc_html( do_shortcode( '[yaymail_domain]' ) . '!' );
36 }
37 if ( 'customer_completed_renewal_order' == $customOrder ) {
38 $emailtext = esc_html__( 'Hi ', 'woocommerce' ) . esc_html( do_shortcode( '[yaymail_billing_first_name]' ) . ', <br /><br/>' ) . esc_html__( 'We have finished processing your subscription renewal order.', 'woocommerce' );
39 $additionalContent = __( 'Thanks for shopping with us.', 'woocommerce' );
40 }
41 if ( 'customer_on_hold_renewal_order' == $customOrder ) {
42 $emailtext = esc_html__( 'Hi ', 'woocommerce' ) . esc_html( do_shortcode( '[yaymail_billing_first_name]' ) . ', <br /><br/>' ) . esc_html__( 'Thanks for your renewal order. It\'s on-hold until we confirm that payment has been received. In the meantime, here\'s a reminder of your order:', 'woocommerce' );
43 $additionalContent = __( 'We look forward to fulfilling your order soon.', 'woocommerce' );
44 }
45 if ( 'customer_renewal_invoice' == $customOrder ) {
46 $emailtext = esc_html__( 'Hi ', 'woocommerce' ) . esc_html( do_shortcode( '[yaymail_billing_first_name]' ) . ', <br /><br/>' );
47 $additionalContent = __( 'Thanks for using ', 'woocommerce' ) . esc_html( do_shortcode( '[yaymail_domain]' ) . '!' );
48 }
49
50 $textShippingAddress = __( 'Shipping Address', 'woocommerce' );
51 $textBillingAddress = __( 'Billing Address', 'woocommerce' );
52
53 /*
54 @@@ Elements default when reset template.
55 @@@ Note 1: Add characters '\' before special characters in a string.
56 @@@ example 1: "family": "\'Helvetica Neue\',Helvetica,Roboto,Arial,sans-serif",
57
58 @@@ Note 2: Add characters '\' before special characters in a string.
59 @@@ example 2: "<h1 style=\"font-family: \'Helvetica Neue\',...."
60 */
61
62 // Elements
63 $elements =
64 '[{
65 "id": "8ffa62b5-7258-42cc-ba53-7ae69638c1fe",
66 "type": "Logo",
67 "nameElement": "Logo",
68 "settingRow": {
69 "backgroundColor": "#ECECEC",
70 "align": "center",
71 "pathImg": "",
72 "paddingTop": "15",
73 "paddingRight": "0",
74 "paddingBottom": "15",
75 "paddingLeft": "0",
76 "width": "172",
77 "url": "#"
78 }
79 },';
80 if ( 'new_renewal_order' != $customOrder && 'customer_processing_renewal_order' != $customOrder && 'customer_completed_renewal_order' != $customOrder && 'customer_on_hold_renewal_order' != $customOrder ) {
81 $elements .= '{
82 "id": "802bfe24-7af8-48af-ac5e-6560a81345b3",
83 "type": "ElementText",
84 "nameElement": "Email Heading",
85 "settingRow": {
86 "content": "<h1 style=\"font-size: 30px; font-weight: 300; line-height: normal; margin: 0; color: inherit;\">' . $emailTitle . ' #[yaymail_order_id]</h1>",
87 "backgroundColor": "#7f54b3",
88 "textColor": "#ffffff",
89 "family": "Helvetica,Roboto,Arial,sans-serif",
90 "paddingTop": "36",
91 "paddingRight": "48",
92 "paddingBottom": "36",
93 "paddingLeft": "48"
94 }
95 },';
96 } else {
97 $elements .= '{
98 "id": "802bfe24-7af8-48af-ac5e-6560a81345b3",
99 "type": "ElementText",
100 "nameElement": "Email Heading",
101 "settingRow": {
102 "content": "<h1 style=\"font-size: 30px; font-weight: 300; line-height: normal; margin: 0; color: inherit;\">' . $emailTitle . '</h1>",
103 "backgroundColor": "#7f54b3",
104 "textColor": "#ffffff",
105 "family": "Helvetica,Roboto,Arial,sans-serif",
106 "paddingTop": "36",
107 "paddingRight": "48",
108 "paddingBottom": "36",
109 "paddingLeft": "48"
110 }
111 },';
112 }
113 $elements .= '{
114 "id": "b035d1f1-0cfe-41c5-b79c-0478f144ef5f",
115 "type": "ElementText",
116 "nameElement": "Text",
117 "settingRow": {
118 "content": "<p style=\"margin: 0px;\"><span style=\"font-size: 14px;\">' . $emailtext . '</span></p>",
119 "backgroundColor": "#fff",
120 "textColor": "#636363",
121 "family": "Helvetica,Roboto,Arial,sans-serif",
122 "paddingTop": "47",
123 "paddingRight": "50",
124 "paddingBottom": "0",
125 "paddingLeft": "50"
126 }
127 },
128 {
129 "id": "ad422370-f762-4a26-92de-c4cf3878h0oi",
130 "type": "OrderItem",
131 "nameElement": "Order Item",
132 "settingRow": {
133 "contentBefore": "[yaymail_items_border_before]",
134 "contentAfter": "[yaymail_items_border_after]",
135 "contentTitle": "[yaymail_items_border_title]",
136 "content": "[yaymail_items_border_content]",
137 "backgroundColor": "#fff",
138 "titleColor" : "#7f54b3",
139 "textColor": "#636363",
140 "borderColor": "#e5e5e5",
141 "family": "Helvetica,Roboto,Arial,sans-serif",
142 "paddingTop": "15",
143 "paddingRight": "50",
144 "paddingBottom": "15",
145 "paddingLeft": "50"
146 }
147 },
148 {
149 "id": "de242956-a617-4213-9107-138842oi4tch",
150 "type": "BillingAddress",
151 "nameElement": "Billing Shipping Address",
152 "settingRow": {
153 "nameColumn": "BillingShippingAddress",
154 "contentTitle": "[yaymail_billing_shipping_address_title]",
155 "checkBillingShipping": "[yaymail_billing_shipping_address_title]",
156 "titleBilling": "' . $textBillingAddress . '",
157 "titleShipping": "' . $textShippingAddress . '",
158 "content": "[yaymail_billing_shipping_address_content]",
159 "titleColor" : "#7f54b3",
160 "backgroundColor": "#fff",
161 "borderColor": "#e5e5e5",
162 "textColor": "#636363",
163 "family": "Helvetica,Roboto,Arial,sans-serif",
164 "paddingTop": "15",
165 "paddingRight": "50",
166 "paddingBottom": "15",
167 "paddingLeft": "50"
168 }
169 },
170 {
171 "id": "b39bf2e6-8c1a-4384-a5ec-37663da27c8d",
172 "type": "ElementText",
173 "nameElement": "Text",
174 "settingRow": {
175 "content": "<p><span style=\"font-size: 14px;\">' . $additionalContent . '</span></p>",
176 "backgroundColor": "#fff",
177 "textColor": "#636363",
178 "family": "Helvetica,Roboto,Arial,sans-serif",
179 "paddingTop": "0",
180 "paddingRight": "50",
181 "paddingBottom": "38",
182 "paddingLeft": "50"
183 }
184 },
185 {
186 "id": "b39bf2e6-8c1a-4384-a5ec-37663da27c8ds",
187 "type": "ElementText",
188 "nameElement": "Footer",
189 "settingRow": {
190 "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>",
191 "backgroundColor": "#ececec",
192 "textColor": "#8a8a8a",
193 "family": "Helvetica,Roboto,Arial,sans-serif",
194 "paddingTop": "15",
195 "paddingRight": "50",
196 "paddingBottom": "15",
197 "paddingLeft": "50"
198 }
199 }]';
200
201 // Templates Cancelled Order
202 $templates = array(
203 $customOrder => array(),
204 );
205
206 $templates[ $customOrder ]['elements'] = $elements;
207 return $templates;
208 }
209 }
210