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