Version Description
Download this release
Release Info
Developer | constantcontact |
Plugin | Creative Mail – Easier WordPress & WooCommerce Email Marketing |
Version | 1.5.0 |
Comparing to | |
See all releases |
Code changes from version 1.4.9 to 1.5.0
- CHANGELOG.md +4 -0
- README.md +2 -1
- creative-mail-plugin.php +3 -3
- readme.txt +2 -1
- src/Managers/ApiManager.php +78 -7
- src/Managers/CheckoutManager.php +34 -0
- src/Modules/Contacts/Handlers/BaseContactFormPluginHandler.php +1 -1
- src/Modules/Contacts/Handlers/WpFormsPluginHandler.php +11 -0
- src/views/activated-integrations.php +96 -0
- vendor/autoload.php +1 -1
- vendor/composer/autoload_real.php +4 -4
- vendor/composer/autoload_static.php +5 -5
CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1 |
Changelog
|
2 |
=========
|
|
|
|
|
|
|
|
|
3 |
|
4 |
#### 1.4.9 - January 3 2022
|
5 |
- Add Flag Customer Orders
|
1 |
Changelog
|
2 |
=========
|
3 |
+
#### 1.5.0 - March 1 2022
|
4 |
+
- Fix WooCommerce product lists
|
5 |
+
- WooCommerce order workflows improved.
|
6 |
+
- Improved contact management
|
7 |
|
8 |
#### 1.4.9 - January 3 2022
|
9 |
- Add Flag Customer Orders
|
README.md
CHANGED
@@ -3,7 +3,7 @@ Contributors: Constant Contact
|
|
3 |
Tags: email, marketing, newsletter, subscribe, contact form, constant contact, crm, automations, ecommerce, promotion, offers, retargeting
|
4 |
Requires at least: 4.6
|
5 |
Tested up to: 5.8
|
6 |
-
Stable tag: 1.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
Requires PHP: 5.6
|
@@ -90,6 +90,7 @@ Creative Mail by Constant Contact [Privacy Notice](https://www.endurance.com/pri
|
|
90 |
6. Enhance your brand with LogoBuilder
|
91 |
|
92 |
== Changelog ==
|
|
|
93 |
* 1.4.9 - Fixes regarding WooCoomerce and Contact Sync Updates.
|
94 |
* 1.4.8 - Redirect to main Creativ Email templates page when user has abandoned cart template deactivated. Fix sync error with contact form 7. Added automation trigger for customer buying products.
|
95 |
* 1.4.7 - Fix currency type being shown in "Abandoned Cart" emails for WooCommerce.
|
3 |
Tags: email, marketing, newsletter, subscribe, contact form, constant contact, crm, automations, ecommerce, promotion, offers, retargeting
|
4 |
Requires at least: 4.6
|
5 |
Tested up to: 5.8
|
6 |
+
Stable tag: 1.5.0
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
Requires PHP: 5.6
|
90 |
6. Enhance your brand with LogoBuilder
|
91 |
|
92 |
== Changelog ==
|
93 |
+
* 1.5.0 - Fix WooCommerce product lists, improved WooCommerce order workflows and improved contact management.
|
94 |
* 1.4.9 - Fixes regarding WooCoomerce and Contact Sync Updates.
|
95 |
* 1.4.8 - Redirect to main Creativ Email templates page when user has abandoned cart template deactivated. Fix sync error with contact form 7. Added automation trigger for customer buying products.
|
96 |
* 1.4.7 - Fix currency type being shown in "Abandoned Cart" emails for WooCommerce.
|
creative-mail-plugin.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* Plugin URI: https://wordpress.org/plugins/creative-mail-by-constant-contact/
|
10 |
* Description: Free email marketing designed specifically for WordPress, Jetpack and WooCommerce. Send newsletters, promotions, updates and transactional e-commerce emails. Simple and easy, powered by Constant Contact’s rock solid reliability.
|
11 |
* Author: Constant Contact
|
12 |
-
* Version: 1.
|
13 |
* Author URI: https://www.constantcontact.com
|
14 |
* WC requires at least: 3.0.0
|
15 |
* WC tested up to: 5.1.0
|
@@ -27,7 +27,7 @@ function _load_ce4wp_plugin()
|
|
27 |
define('CE4WP_PLUGIN_DIR', __DIR__ . '/');
|
28 |
define('CE4WP_PLUGIN_URL', plugin_dir_url(__FILE__) . '/');
|
29 |
define('CE4WP_PLUGIN_FILE', __FILE__);
|
30 |
-
define('CE4WP_PLUGIN_VERSION', '1.
|
31 |
define('CE4WP_INSTANCE_UUID_KEY', 'ce4wp_instance_uuid');
|
32 |
define('CE4WP_INSTANCE_HANDSHAKE_TOKEN', 'ce4wp_handshake_token');
|
33 |
define('CE4WP_INSTANCE_HANDSHAKE_EXPIRATION', 'ce4wp_handshake_expiration');
|
@@ -44,7 +44,7 @@ function _load_ce4wp_plugin()
|
|
44 |
define('CE4WP_APP_GATEWAY_URL', 'https://app-gateway.creativemail.com/');
|
45 |
define('CE4WP_APP_URL', 'https://app.creativemail.com/');
|
46 |
define('CE4WP_ENVIRONMENT', 'PRODUCTION');
|
47 |
-
define('CE4WP_BUILD_NUMBER', '
|
48 |
define('CE4WP_RAYGUN_PHP_KEY', 'Z85xL3mkgnW13Ri9DajGUg');
|
49 |
define('CE4WP_BATCH_SIZE', 500);
|
50 |
define('CE4WP_WC_API_KEY_ID', 'ce4wp_woocommerce_api_key_id');
|
9 |
* Plugin URI: https://wordpress.org/plugins/creative-mail-by-constant-contact/
|
10 |
* Description: Free email marketing designed specifically for WordPress, Jetpack and WooCommerce. Send newsletters, promotions, updates and transactional e-commerce emails. Simple and easy, powered by Constant Contact’s rock solid reliability.
|
11 |
* Author: Constant Contact
|
12 |
+
* Version: 1.5.0
|
13 |
* Author URI: https://www.constantcontact.com
|
14 |
* WC requires at least: 3.0.0
|
15 |
* WC tested up to: 5.1.0
|
27 |
define('CE4WP_PLUGIN_DIR', __DIR__ . '/');
|
28 |
define('CE4WP_PLUGIN_URL', plugin_dir_url(__FILE__) . '/');
|
29 |
define('CE4WP_PLUGIN_FILE', __FILE__);
|
30 |
+
define('CE4WP_PLUGIN_VERSION', '1.5.0');
|
31 |
define('CE4WP_INSTANCE_UUID_KEY', 'ce4wp_instance_uuid');
|
32 |
define('CE4WP_INSTANCE_HANDSHAKE_TOKEN', 'ce4wp_handshake_token');
|
33 |
define('CE4WP_INSTANCE_HANDSHAKE_EXPIRATION', 'ce4wp_handshake_expiration');
|
44 |
define('CE4WP_APP_GATEWAY_URL', 'https://app-gateway.creativemail.com/');
|
45 |
define('CE4WP_APP_URL', 'https://app.creativemail.com/');
|
46 |
define('CE4WP_ENVIRONMENT', 'PRODUCTION');
|
47 |
+
define('CE4WP_BUILD_NUMBER', '1607');
|
48 |
define('CE4WP_RAYGUN_PHP_KEY', 'Z85xL3mkgnW13Ri9DajGUg');
|
49 |
define('CE4WP_BATCH_SIZE', 500);
|
50 |
define('CE4WP_WC_API_KEY_ID', 'ce4wp_woocommerce_api_key_id');
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: Constant Contact
|
|
3 |
Tags: email, marketing, newsletter, subscribe, contact form, constant contact, crm, automations, ecommerce, promotion, offers, retargeting
|
4 |
Requires at least: 4.6
|
5 |
Tested up to: 5.8
|
6 |
-
Stable tag: 1.
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
Requires PHP: 5.6
|
@@ -104,6 +104,7 @@ Creative Mail by Constant Contact [Privacy Notice](https://www.endurance.com/pri
|
|
104 |
6. Enhance your brand with LogoBuilder
|
105 |
|
106 |
== Changelog ==
|
|
|
107 |
* 1.4.9 - Fixes regarding WooCoomerce and Contact Sync Updates.
|
108 |
* 1.4.8 - Redirect to main Creativ Email templates page when user has abandoned cart template deactivated. Fix sync error with contact form 7. Added automation trigger for customer buying products.
|
109 |
* 1.4.7 - Fix currency type being shown in "Abandoned Cart" emails for WooCommerce.
|
3 |
Tags: email, marketing, newsletter, subscribe, contact form, constant contact, crm, automations, ecommerce, promotion, offers, retargeting
|
4 |
Requires at least: 4.6
|
5 |
Tested up to: 5.8
|
6 |
+
Stable tag: 1.5.0
|
7 |
License: GPLv2 or later
|
8 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
Requires PHP: 5.6
|
104 |
6. Enhance your brand with LogoBuilder
|
105 |
|
106 |
== Changelog ==
|
107 |
+
* 1.5.0 - Fix WooCommerce product lists, improved WooCommerce order workflows and improved contact management.
|
108 |
* 1.4.9 - Fixes regarding WooCoomerce and Contact Sync Updates.
|
109 |
* 1.4.8 - Redirect to main Creativ Email templates page when user has abandoned cart template deactivated. Fix sync error with contact form 7. Added automation trigger for customer buying products.
|
110 |
* 1.4.7 - Fix currency type being shown in "Abandoned Cart" emails for WooCommerce.
|
src/Managers/ApiManager.php
CHANGED
@@ -189,11 +189,20 @@ class ApiManager
|
|
189 |
self::ROUTE_METHODS => 'GET',
|
190 |
self::ROUTE_CALLBACK => function ($request) {
|
191 |
$productData = array();
|
|
|
192 |
$active_plugins = apply_filters('active_plugins', get_option('active_plugins'));
|
193 |
if (in_array('woocommerce/woocommerce.php', $active_plugins)) {
|
194 |
$page = 1;
|
195 |
-
|
196 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
}
|
198 |
|
199 |
$types = array_merge( array_keys( wc_get_product_types() ) );
|
@@ -205,16 +214,21 @@ class ApiManager
|
|
205 |
// Get 25 most recent products
|
206 |
$products = wc_get_products(
|
207 |
array(
|
208 |
-
|
209 |
-
|
210 |
-
|
|
|
211 |
)
|
212 |
);
|
213 |
-
|
|
|
214 |
array_push($productData, new WCProductModel($product->get_data()));
|
215 |
}
|
216 |
}
|
217 |
-
|
|
|
|
|
|
|
218 |
}
|
219 |
),
|
220 |
array (
|
@@ -306,6 +320,63 @@ class ApiManager
|
|
306 |
$blocks = $this->find_pages_by_content_tag("wp:ce4wp/subscribe");
|
307 |
return $this->modify_response(new WP_REST_Response($blocks, 200));
|
308 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
309 |
)
|
310 |
);
|
311 |
|
189 |
self::ROUTE_METHODS => 'GET',
|
190 |
self::ROUTE_CALLBACK => function ($request) {
|
191 |
$productData = array();
|
192 |
+
$products = array();
|
193 |
$active_plugins = apply_filters('active_plugins', get_option('active_plugins'));
|
194 |
if (in_array('woocommerce/woocommerce.php', $active_plugins)) {
|
195 |
$page = 1;
|
196 |
+
$limit = 25;
|
197 |
+
|
198 |
+
$pageFromRequest = $request->get_param('page');
|
199 |
+
if(!empty($pageFromRequest) && $pageFromRequest != '{page}') {
|
200 |
+
$page = $pageFromRequest;
|
201 |
+
}
|
202 |
+
|
203 |
+
$pageLimitFromRequest = $request->get_param('limit');
|
204 |
+
if(!empty($pageLimitFromRequest) && $pageLimitFromRequest != '{limit}') {
|
205 |
+
$limit = $pageLimitFromRequest;
|
206 |
}
|
207 |
|
208 |
$types = array_merge( array_keys( wc_get_product_types() ) );
|
214 |
// Get 25 most recent products
|
215 |
$products = wc_get_products(
|
216 |
array(
|
217 |
+
'limit' => $limit,
|
218 |
+
'paginate' => true,
|
219 |
+
'paged' => $page,
|
220 |
+
'type' => $types
|
221 |
)
|
222 |
);
|
223 |
+
|
224 |
+
foreach ($products->products as $product) {
|
225 |
array_push($productData, new WCProductModel($product->get_data()));
|
226 |
}
|
227 |
}
|
228 |
+
$response = new WP_REST_Response($productData, 200);
|
229 |
+
$response->header( 'X-WP-Total', $products->total );
|
230 |
+
$response->header( 'X-WP-TotalPages', $products->max_num_pages );
|
231 |
+
return $this->modify_response($response);
|
232 |
}
|
233 |
),
|
234 |
array (
|
320 |
$blocks = $this->find_pages_by_content_tag("wp:ce4wp/subscribe");
|
321 |
return $this->modify_response(new WP_REST_Response($blocks, 200));
|
322 |
}
|
323 |
+
),
|
324 |
+
array (
|
325 |
+
self::ROUTE_PATH => '/check_if_previously_purchased',
|
326 |
+
self::ROUTE_METHODS => 'GET',
|
327 |
+
self::ROUTE_CALLBACK => function ($request) {
|
328 |
+
|
329 |
+
$active_plugins = apply_filters('active_plugins', get_option('active_plugins'));
|
330 |
+
if (in_array('woocommerce/woocommerce.php', $active_plugins)) {
|
331 |
+
|
332 |
+
$product_ID = $request->get_param('product');
|
333 |
+
$email = $request->get_param('email');
|
334 |
+
$daysPassedFloat = 86400 * $request->get_param('daysPassed');
|
335 |
+
$daysPassed = round($daysPassedFloat);
|
336 |
+
|
337 |
+
$currentDay = new \DateTime();
|
338 |
+
$currentDate = $currentDay->format('Y-m-d H:i:s');
|
339 |
+
$currentTime = strtotime($currentDate);
|
340 |
+
|
341 |
+
$date = new \DateTime();
|
342 |
+
$date->sub(new \DateInterval("PT{$daysPassed}S"));
|
343 |
+
$initial_date = $date->format('Y-m-d H:i:s');
|
344 |
+
$initialTime = strtotime($initial_date);
|
345 |
+
$exists = false;
|
346 |
+
|
347 |
+
$order = wc_get_orders( array(
|
348 |
+
'billing_email' => $email,
|
349 |
+
'date_created' => "$initialTime...$currentTime",
|
350 |
+
'status' => array('wc-completed')
|
351 |
+
));
|
352 |
+
|
353 |
+
if(!empty($product_ID)) {
|
354 |
+
|
355 |
+
foreach ($order as $itemsKey => $item) {
|
356 |
+
$orderData = $item->get_data();
|
357 |
+
|
358 |
+
foreach($orderData['line_items'] as $lineItem) {
|
359 |
+
$product = $lineItem->get_product()->get_data();
|
360 |
+
|
361 |
+
foreach($product_ID as $p_ID) {
|
362 |
+
if($p_ID == $product['id']) {
|
363 |
+
$exists = true;
|
364 |
+
}
|
365 |
+
}
|
366 |
+
}
|
367 |
+
if($exists) {
|
368 |
+
break;
|
369 |
+
}
|
370 |
+
}
|
371 |
+
}
|
372 |
+
else {
|
373 |
+
if(!empty($order)) {
|
374 |
+
$exists = true;
|
375 |
+
}
|
376 |
+
}
|
377 |
+
return $this->modify_response(new WP_REST_Response($exists, 200));
|
378 |
+
}
|
379 |
+
}
|
380 |
)
|
381 |
);
|
382 |
|
src/Managers/CheckoutManager.php
CHANGED
@@ -6,6 +6,7 @@ namespace CreativeMail\Managers;
|
|
6 |
use CreativeMail\CreativeMail;
|
7 |
use CreativeMail\Helpers\EnvironmentHelper;
|
8 |
use CreativeMail\Helpers\OptionsHelper;
|
|
|
9 |
use stdClass;
|
10 |
use WC_Coupon;
|
11 |
use WC_Order;
|
@@ -751,6 +752,32 @@ class CheckoutManager
|
|
751 |
}
|
752 |
}
|
753 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
754 |
public function add_order_completed_wc_hooks() {
|
755 |
add_action('woocommerce_order_status_completed', array($this, 'order_completed_trigger_wc_hook'), 10, 1);
|
756 |
}
|
@@ -761,6 +788,8 @@ class CheckoutManager
|
|
761 |
return;
|
762 |
}
|
763 |
|
|
|
|
|
764 |
$endpoint = '/v1.0/wc/order_completed';
|
765 |
$decimal_point = 2;
|
766 |
|
@@ -779,6 +808,11 @@ class CheckoutManager
|
|
779 |
$requestItem->customer_id = $order->get_user_id();
|
780 |
// Order Billing
|
781 |
$requestItem->order->billing->email = $order->get_billing_email();
|
|
|
|
|
|
|
|
|
|
|
782 |
$requestItem->order->billing->first_name = $order->get_billing_first_name();
|
783 |
$requestItem->order->billing->last_name = $order->get_billing_last_name();
|
784 |
$requestItem->order->billing->is_first_time_buyer = count(wc_get_orders(array('email' => $order->get_billing_email()))) <= 1;
|
6 |
use CreativeMail\CreativeMail;
|
7 |
use CreativeMail\Helpers\EnvironmentHelper;
|
8 |
use CreativeMail\Helpers\OptionsHelper;
|
9 |
+
use CreativeMail\Modules\Contacts\Models\OptActionBy;
|
10 |
use stdClass;
|
11 |
use WC_Coupon;
|
12 |
use WC_Order;
|
752 |
}
|
753 |
}
|
754 |
|
755 |
+
private function get_opt_action_by($products_detail) {
|
756 |
+
return OptActionBy::Visitor;
|
757 |
+
}
|
758 |
+
|
759 |
+
private function get_opt_in_checkbox_value($products_detail) {
|
760 |
+
if (!empty($products_detail["ce4wp_checkout_consent"])) {
|
761 |
+
return $products_detail["ce4wp_checkout_consent"][0]; //this value appears to be in array;
|
762 |
+
}
|
763 |
+
|
764 |
+
return null;
|
765 |
+
}
|
766 |
+
|
767 |
+
private function get_opt_in($products_detail) {
|
768 |
+
$checkbox_value = $this->get_opt_in_checkbox_value($products_detail);
|
769 |
+
if ($checkbox_value == true)
|
770 |
+
return true;
|
771 |
+
return null;
|
772 |
+
}
|
773 |
+
|
774 |
+
private function get_opt_out($products_detail) {
|
775 |
+
$checkbox_value = $this->get_opt_in_checkbox_value($products_detail);
|
776 |
+
if ($checkbox_value == false)
|
777 |
+
return true;
|
778 |
+
return null;
|
779 |
+
}
|
780 |
+
|
781 |
public function add_order_completed_wc_hooks() {
|
782 |
add_action('woocommerce_order_status_completed', array($this, 'order_completed_trigger_wc_hook'), 10, 1);
|
783 |
}
|
788 |
return;
|
789 |
}
|
790 |
|
791 |
+
$products_detail = get_post_meta($order_id);
|
792 |
+
|
793 |
$endpoint = '/v1.0/wc/order_completed';
|
794 |
$decimal_point = 2;
|
795 |
|
808 |
$requestItem->customer_id = $order->get_user_id();
|
809 |
// Order Billing
|
810 |
$requestItem->order->billing->email = $order->get_billing_email();
|
811 |
+
|
812 |
+
$requestItem->order->billing->opt_action_by = $this->get_opt_action_by($products_detail);
|
813 |
+
$requestItem->order->billing->opt_in = $this->get_opt_in($products_detail);
|
814 |
+
$requestItem->order->billing->opt_out = $this->get_opt_out($products_detail);
|
815 |
+
|
816 |
$requestItem->order->billing->first_name = $order->get_billing_first_name();
|
817 |
$requestItem->order->billing->last_name = $order->get_billing_last_name();
|
818 |
$requestItem->order->billing->is_first_time_buyer = count(wc_get_orders(array('email' => $order->get_billing_email()))) <= 1;
|
src/Modules/Contacts/Handlers/BaseContactFormPluginHandler.php
CHANGED
@@ -19,7 +19,7 @@ abstract class BaseContactFormPluginHandler
|
|
19 |
protected $emailFields = array('your-email', 'email', 'e-mail', 'emailaddress', 'email_address', 'email address', 'email-address', 'e-mail address', 'UserEmailAddress');
|
20 |
protected $firstnameFields = array('firstname', 'first_name', 'name', 'your-name', 'first name', 'first-name', 'first', 'UserFirstName');
|
21 |
protected $lastnameFields = array('lastname', 'last_name', 'last name', 'last-name', 'last', 'UserLastName');
|
22 |
-
protected $consentFields = array('acceptance', 'consent');
|
23 |
|
24 |
public function upsertContact($model)
|
25 |
{
|
19 |
protected $emailFields = array('your-email', 'email', 'e-mail', 'emailaddress', 'email_address', 'email address', 'email-address', 'e-mail address', 'UserEmailAddress');
|
20 |
protected $firstnameFields = array('firstname', 'first_name', 'name', 'your-name', 'first name', 'first-name', 'first', 'UserFirstName');
|
21 |
protected $lastnameFields = array('lastname', 'last_name', 'last name', 'last-name', 'last', 'UserLastName');
|
22 |
+
protected $consentFields = array('accept-this', 'acceptance', 'consent');
|
23 |
|
24 |
public function upsertContact($model)
|
25 |
{
|
src/Modules/Contacts/Handlers/WpFormsPluginHandler.php
CHANGED
@@ -62,6 +62,17 @@ class WpFormsPluginHandler extends BaseContactFormPluginHandler
|
|
62 |
}
|
63 |
}
|
64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
$phoneField = $this->get_form_type_field($formData, 'phone');
|
66 |
if (!empty($phoneField)) {
|
67 |
if (!empty($phoneField['value'])) {
|
62 |
}
|
63 |
}
|
64 |
|
65 |
+
if(empty($contactModel -> firstName) && empty($contactModel -> lastName) && !empty($nameField) && !empty($nameField['value']))
|
66 |
+
{
|
67 |
+
$nameValues = preg_split ('/ /', $nameField['value']);
|
68 |
+
$arrLength = count($nameValues);
|
69 |
+
$contactModel->setFirstName($nameValues[0]);
|
70 |
+
if($arrLength > 1)
|
71 |
+
{
|
72 |
+
$contactModel->setLastName($nameValues[$arrLength - 1]);
|
73 |
+
}
|
74 |
+
}
|
75 |
+
|
76 |
$phoneField = $this->get_form_type_field($formData, 'phone');
|
77 |
if (!empty($phoneField)) {
|
78 |
if (!empty($phoneField['value'])) {
|
src/views/activated-integrations.php
CHANGED
@@ -5,6 +5,7 @@ use CreativeMail\Helpers\EnvironmentHelper;
|
|
5 |
|
6 |
$available_integrations = CreativeMail::get_instance()->get_integration_manager()->get_active_plugins();
|
7 |
$activated_integrations = CreativeMail::get_instance()->get_integration_manager()->get_activated_integrations();
|
|
|
8 |
|
9 |
?>
|
10 |
|
@@ -29,11 +30,37 @@ $activated_integrations = CreativeMail::get_instance()->get_integration_manager(
|
|
29 |
document.getElementById('activated_plugins_form').submit()
|
30 |
}
|
31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
function onChecked(slug){
|
33 |
var card = document.getElementById('activated-plugins-' + slug);
|
34 |
if(card !== undefined && card !== null) {
|
35 |
card.classList.toggle("ce4wp-selected")
|
36 |
}
|
|
|
|
|
|
|
|
|
|
|
37 |
}
|
38 |
</script>
|
39 |
|
@@ -149,5 +176,74 @@ $activated_integrations = CreativeMail::get_instance()->get_integration_manager(
|
|
149 |
</div>
|
150 |
</div>
|
151 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
</form>
|
153 |
|
5 |
|
6 |
$available_integrations = CreativeMail::get_instance()->get_integration_manager()->get_active_plugins();
|
7 |
$activated_integrations = CreativeMail::get_instance()->get_integration_manager()->get_activated_integrations();
|
8 |
+
$activated_templates = CreativeMail::get_instance()->get_email_manager()->get_managed_email_notifications();
|
9 |
|
10 |
?>
|
11 |
|
30 |
document.getElementById('activated_plugins_form').submit()
|
31 |
}
|
32 |
|
33 |
+
// Let customer know that contacts will be synced if WooCommerce email templates are enabled even if the integration is disabled
|
34 |
+
function showWooCommerceTemplateConsentModal() {
|
35 |
+
var wooCommerceModal = document.getElementById('woocommerce-consent-modal');
|
36 |
+
if (wooCommerceModal) {
|
37 |
+
wooCommerceModal.style.display = "block";
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
function closeWooCommerceTemplateConsentModal (activateCheckbox) {
|
42 |
+
var wooCommerceModal = document.getElementById('woocommerce-consent-modal');
|
43 |
+
var wooCommerceCheckbox = document.getElementById('activated-plugins-check-woocommerce');
|
44 |
+
|
45 |
+
if (wooCommerceCheckbox && activateCheckbox === true) {
|
46 |
+
document.getElementById('activated-plugins-check-woocommerce').checked = true;
|
47 |
+
}
|
48 |
+
|
49 |
+
if (wooCommerceModal) {
|
50 |
+
document.getElementById('woocommerce-consent-modal').style.display = "none";
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
function onChecked(slug){
|
55 |
var card = document.getElementById('activated-plugins-' + slug);
|
56 |
if(card !== undefined && card !== null) {
|
57 |
card.classList.toggle("ce4wp-selected")
|
58 |
}
|
59 |
+
|
60 |
+
var checkbox = document.getElementById('activated-plugins-check-' + slug);
|
61 |
+
if (card.id === 'activated-plugins-woocommerce' && checkbox.checked === false) {
|
62 |
+
showWooCommerceTemplateConsentModal();
|
63 |
+
}
|
64 |
}
|
65 |
</script>
|
66 |
|
176 |
</div>
|
177 |
</div>
|
178 |
</div>
|
179 |
+
|
180 |
+
<!-- WooCommerce Template Consent modal -->
|
181 |
+
<?php
|
182 |
+
function get_active_options($option)
|
183 |
+
{
|
184 |
+
return $option->active === true;
|
185 |
+
}
|
186 |
+
|
187 |
+
if (sizeof(array_filter($activated_templates, 'get_active_options')) > 0) {
|
188 |
+
echo'
|
189 |
+
<div id="woocommerce-consent-modal" role="presentation" class="ce4wp-dialog-root" height="auto" variant="default" style="display: none;">
|
190 |
+
<div class="ce4wp-backdrop-root" aria-hidden="true" style="opacity: 1; "></div>
|
191 |
+
<div class="ce4wp-dialog-container" role="none presentation" tabindex="-1" style="opacity: 1; ">
|
192 |
+
<div class="ce4wp-dialog-wrapper" role="dialog">
|
193 |
+
<div width="100%" class="ce4wp-dialog-header">
|
194 |
+
<div class="ce4wp-dialog-header-title">
|
195 |
+
<div class="ce4wp-dialog-header-title-wrapper">
|
196 |
+
<div class="ce4wp-dialog-header-title-wrapper-content">
|
197 |
+
<h3 class="ce4wp-typography-root ce4wp-typography-h3">' . __('Disabling WooCommerce', 'ce4wp') . '</h3>
|
198 |
+
</div>
|
199 |
+
</div>
|
200 |
+
</div>
|
201 |
+
<div class="ce4wp-dialog-header-close">
|
202 |
+
<div class="ce4wp-dialog-header-close-wrapper" onclick="closeWooCommerceTemplateConsentModal(true)">
|
203 |
+
<div class="ce4wp-dialog-header-close-wrapper-button">
|
204 |
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="black" xmlns="http://www.w3.org/2000/svg">
|
205 |
+
<path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" />
|
206 |
+
</svg>
|
207 |
+
</div>
|
208 |
+
</div>
|
209 |
+
</div>
|
210 |
+
</div>
|
211 |
+
<div id="consent-modal-activated-loader" height="auto" class="ce4wp-dialog-content ce4wp-hidden">
|
212 |
+
<div class="ce4wp-loader" role="progressbar" style="width: 40px; height: 40px;">
|
213 |
+
<svg class="core-test-MuiCircularProgress-svg" viewBox="22 22 44 44">
|
214 |
+
<circle class="core-test-MuiCircularProgress-circle core-test-MuiCircularProgress-circleIndeterminate" cx="44" cy="44" r="20.2" fill="none" stroke-width="3.6"></circle>
|
215 |
+
</svg>
|
216 |
+
</div>
|
217 |
+
</div>
|
218 |
+
<div id="consent-modal-activated-content">
|
219 |
+
<div height="auto" class="ce4wp-dialog-content">
|
220 |
+
<div>
|
221 |
+
<div class="ce4wp-pb-3">
|
222 |
+
<span>' . __( 'Before you disable the WooCommerce integration, please keep in mind the following:', 'ce4wp') . '</span>
|
223 |
+
</div>
|
224 |
+
<div class="ce4wp-pb-3">
|
225 |
+
<span>' . __( 'If you have enabled CreativeMail to handle WooCommerce emails, contacts\' email addresses will continue to be synced.', 'ce4wp') . '</span>
|
226 |
+
</div>
|
227 |
+
<div class="ce4wp-pb-3">
|
228 |
+
<span>' . __( 'If you wish to stop contacts from being synced, please make sure to disable all WooCommerce emails from being handled by CreativeMail.', 'ce4wp') . '</span>
|
229 |
+
</div>
|
230 |
+
</div>
|
231 |
+
</div>
|
232 |
+
<div class="ce4wp-dialog-footer">
|
233 |
+
<div class="ce4wp-dialog-footer-close">
|
234 |
+
<div class="ce4wp-dialog-footer-close-wrapper">
|
235 |
+
<button class="ce4wp-button-base-root ce4wp-button-root ce4wp-button-contained ce4wp-button-contained-primary" type="button" onclick="closeWooCommerceTemplateConsentModal(false)">
|
236 |
+
<span class="MuiButton-label">' . __('Got it!', 'ce4wp') . '</span>
|
237 |
+
</button>
|
238 |
+
</div>
|
239 |
+
</div>
|
240 |
+
</div>
|
241 |
+
</div>
|
242 |
+
</div>
|
243 |
+
</div>
|
244 |
+
</div>
|
245 |
+
';
|
246 |
+
}
|
247 |
+
?>
|
248 |
</form>
|
249 |
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInit8d22ccb6673585e204258acc03bcb64b::getLoader();
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -22,15 +22,15 @@ class ComposerAutoloaderInit58eec2d19561196f84a677438bdfe34e
|
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
-
spl_autoload_register(array('
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
27 |
-
spl_autoload_unregister(array('
|
28 |
|
29 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
if ($useStaticLoader) {
|
31 |
require_once __DIR__ . '/autoload_static.php';
|
32 |
|
33 |
-
call_user_func(\Composer\Autoload\
|
34 |
} else {
|
35 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
36 |
foreach ($map as $namespace => $path) {
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInit8d22ccb6673585e204258acc03bcb64b
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
22 |
return self::$loader;
|
23 |
}
|
24 |
|
25 |
+
spl_autoload_register(array('ComposerAutoloaderInit8d22ccb6673585e204258acc03bcb64b', 'loadClassLoader'), true, true);
|
26 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
27 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit8d22ccb6673585e204258acc03bcb64b', 'loadClassLoader'));
|
28 |
|
29 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
30 |
if ($useStaticLoader) {
|
31 |
require_once __DIR__ . '/autoload_static.php';
|
32 |
|
33 |
+
call_user_func(\Composer\Autoload\ComposerStaticInit8d22ccb6673585e204258acc03bcb64b::getInitializer($loader));
|
34 |
} else {
|
35 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
36 |
foreach ($map as $namespace => $path) {
|
vendor/composer/autoload_static.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'F' =>
|
@@ -167,10 +167,10 @@ class ComposerStaticInit58eec2d19561196f84a677438bdfe34e
|
|
167 |
public static function getInitializer(ClassLoader $loader)
|
168 |
{
|
169 |
return \Closure::bind(function () use ($loader) {
|
170 |
-
$loader->prefixLengthsPsr4 =
|
171 |
-
$loader->prefixDirsPsr4 =
|
172 |
-
$loader->prefixesPsr0 =
|
173 |
-
$loader->classMap =
|
174 |
|
175 |
}, null, ClassLoader::class);
|
176 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInit8d22ccb6673585e204258acc03bcb64b
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'F' =>
|
167 |
public static function getInitializer(ClassLoader $loader)
|
168 |
{
|
169 |
return \Closure::bind(function () use ($loader) {
|
170 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInit8d22ccb6673585e204258acc03bcb64b::$prefixLengthsPsr4;
|
171 |
+
$loader->prefixDirsPsr4 = ComposerStaticInit8d22ccb6673585e204258acc03bcb64b::$prefixDirsPsr4;
|
172 |
+
$loader->prefixesPsr0 = ComposerStaticInit8d22ccb6673585e204258acc03bcb64b::$prefixesPsr0;
|
173 |
+
$loader->classMap = ComposerStaticInit8d22ccb6673585e204258acc03bcb64b::$classMap;
|
174 |
|
175 |
}, null, ClassLoader::class);
|
176 |
}
|