Skip to content

Commit

Permalink
Change namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
nerijuszaniauskas committed Feb 13, 2024
1 parent f99aec2 commit f84f2fb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions omnisend-for-gravity-forms/class-omnisendaddon.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @package OmnisendGravityFormsPlugin
*/

use Omnisend\Sdk\V1\Contact;
use Omnisend\SDK\V1\Contact;

if ( ! defined( 'ABSPATH' ) ) {
exit;
Expand Down Expand Up @@ -41,13 +41,13 @@ public function omnisend_custom_requirement_callback( $meets_requirements ) {
return $meets_requirements;
}

if ( ! class_exists( 'Omnisend\Sdk\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\Sdk\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';
}
Expand Down Expand Up @@ -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\Sdk\V1\Omnisend' ) ) {
if ( ! class_exists( 'Omnisend\SDK\V1\Omnisend' ) ) {
return;
}

Expand Down Expand Up @@ -351,7 +351,7 @@ public function after_submission( $entry, $form ) {

$this->mapCustomProperties( $form, $entry, $settings, $contact );

$response = \Omnisend\Sdk\V1\Omnisend::get_client( OMNISEND_GRAVITY_ADDON_NAME, OMNISEND_GRAVITY_ADDON_VERSION )->create_contact( $contact );
$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;
Expand Down

0 comments on commit f84f2fb

Please sign in to comment.