diff --git a/omnisend-for-gravity-forms/class-omnisend-addon-bootstrap.php b/omnisend-for-gravity-forms/class-omnisend-addon-bootstrap.php index eabfdc1..1d90e21 100644 --- a/omnisend-for-gravity-forms/class-omnisend-addon-bootstrap.php +++ b/omnisend-for-gravity-forms/class-omnisend-addon-bootstrap.php @@ -2,7 +2,7 @@ /** * Plugin Name: Omnisend for Gravity Forms Add-On * Description: A gravity forms add-on to sync contacts with Omnisend. In collaboration with Omnisnnd for WooCommerce plugin it enables better customer tracking - * Version: 1.1.1 + * Version: 1.2.0 * Author: Omnisend * Author URI: https://www.omnisend.com * Developer: Omnisend diff --git a/omnisend-for-gravity-forms/class-omnisendaddon.php b/omnisend-for-gravity-forms/class-omnisendaddon.php index b8ba1b5..71d4cd1 100644 --- a/omnisend-for-gravity-forms/class-omnisendaddon.php +++ b/omnisend-for-gravity-forms/class-omnisendaddon.php @@ -5,7 +5,7 @@ * @package OmnisendGravityFormsPlugin */ -use Omnisend\Public\V1\Contact; +use Omnisend\SDK\V1\Contact; if ( ! defined( 'ABSPATH' ) ) { exit; @@ -41,13 +41,13 @@ public function omnisend_custom_requirement_callback( $meets_requirements ) { return $meets_requirements; } - if ( ! class_exists( 'Omnisend\Public\V1\Omnisend' ) ) { + if ( ! class_exists( 'Omnisend\SDK\V1\Omnisend' ) ) { $meets_requirements['meets_requirements'] = false; $meets_requirements['errors'][] = 'Your Email Marketing by Omnisend is not up to date. Please update plugins'; return $meets_requirements; } - if ( ! Omnisend\Public\V1\Omnisend::is_connected() ) { + if ( ! Omnisend\SDK\V1\Omnisend::is_connected() ) { $meets_requirements['meets_requirements'] = false; $meets_requirements['errors'][] = 'Your Email Marketing by Omnisend is not configured properly. Please configure it firstly'; } @@ -265,7 +265,7 @@ public function form_settings_fields( $form ) { * @param array $form The form currently being processed. */ public function after_submission( $entry, $form ) { - if ( ! class_exists( 'Omnisend\Public\V1\Omnisend' ) ) { + if ( ! class_exists( 'Omnisend\SDK\V1\Omnisend' ) ) { return; } @@ -351,14 +351,9 @@ public function after_submission( $entry, $form ) { $this->mapCustomProperties( $form, $entry, $settings, $contact ); - $response = \Omnisend\Public\V1\Omnisend::get_client( OMNISEND_GRAVITY_ADDON_NAME, OMNISEND_GRAVITY_ADDON_VERSION )->create_contact( $contact ); - if ( is_wp_error( $response ) ) { - error_log( 'Error in after_submission: ' . $response->get_error_message()); // phpcs:ignore - return; - } - - if ( ! is_string( $response ) ) { - error_log( 'Unexpected error. Please contact Omnisend support.'); // phpcs:ignore + $response = \Omnisend\SDK\V1\Omnisend::get_client( OMNISEND_GRAVITY_ADDON_NAME, OMNISEND_GRAVITY_ADDON_VERSION )->create_contact( $contact ); + if ( $response->get_wp_error()->has_errors() ) { + error_log( 'Error in after_submission: ' . $response->get_wp_error()->get_error_message()); // phpcs:ignore return; } diff --git a/omnisend-for-gravity-forms/readme.txt b/omnisend-for-gravity-forms/readme.txt index 4b1c3e0..2ce3227 100644 --- a/omnisend-for-gravity-forms/readme.txt +++ b/omnisend-for-gravity-forms/readme.txt @@ -5,7 +5,7 @@ Tags: Gravity forms, form, email marketing, web tracking, subscriber collection Requires at least: 4.7.0 Tested up to: 6.4 Requires PHP: 7.1 -Stable tag: 1.1.1 +Stable tag: 1.2.0 License: GPLv3 or later License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -61,6 +61,10 @@ Read Omnisend [Terms of Use](https://www.omnisend.com/terms) == Changelog == += 1.2.0 = + +* Use Updated Omnisend plugin. + = 1.1.1 = * Update plugin icon.