diff --git a/omnisend-for-formidable-forms-add-on/class-omnisend-formidableformsaddon-bootstrap.php b/omnisend-for-formidable-forms-add-on/class-omnisend-formidableformsaddon-bootstrap.php
index 286673d..eadda03 100644
--- a/omnisend-for-formidable-forms-add-on/class-omnisend-formidableformsaddon-bootstrap.php
+++ b/omnisend-for-formidable-forms-add-on/class-omnisend-formidableformsaddon-bootstrap.php
@@ -2,7 +2,7 @@
/**
* Plugin Name: Omnisend for Formidable Forms Add-On
* Description: A Formidable forms add-on to sync contacts with Omnisend. In collaboration with Omnisnnd for WooCommerce plugin it enables better customer tracking
- * Version: 1.0.4
+ * Version: 1.1.0
* Author: Omnisend
* Author URI: https://www.omnisend.com
* Developer: Omnisend
@@ -21,9 +21,10 @@
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
-define( 'OMNISEND_FORMIDABLE_ADDON_VERSION', '1.0.1' );
-add_action( 'frm_registered_form_actions', array( 'Omnisend_FormidableFormsAddOn_Bootstrap', 'register_actions' ), 10, 1 );
+define( 'OMNISEND_FORMIDABLE_ADDON_NAME', 'Omnisend for Formidable Forms Add-On' );
+define( 'OMNISEND_FORMIDABLE_ADDON_VERSION', '1.1.0' );
+
spl_autoload_register( array( 'Omnisend_FormidableFormsAddOn_Bootstrap', 'autoloader' ) );
add_action( 'plugins_loaded', array( 'Omnisend_FormidableFormsAddOn_Bootstrap', 'check_plugin_requirements' ) );
add_action( 'admin_enqueue_scripts', array( 'Omnisend_FormidableFormsAddOn_Bootstrap', 'load_custom_wp_admin_style' ) );
@@ -77,11 +78,11 @@ public static function check_plugin_requirements() {
require_once ABSPATH . '/wp-admin/includes/plugin.php';
$formidable_addon_plugin = 'omnisend-for-formidable-forms-add-on/class-omnisend-formidableformsaddon-bootstrap.php';
- $omnisend_plugin = 'omnisend-connect/omnisend-woocommerce.php';
+ $omnisend_plugin = 'omnisend/class-omnisend-core-bootstrap.php';
if ( ! file_exists( WP_PLUGIN_DIR . '/' . $omnisend_plugin ) || ! is_plugin_active( $omnisend_plugin ) ) {
deactivate_plugins( $formidable_addon_plugin );
- add_action( 'admin_notices', array( 'Omnisend_FormidableFormsAddOn_Bootstrap', 'omnisend_woocommerce_notice' ) );
+ add_action( 'admin_notices', array( 'Omnisend_FormidableFormsAddOn_Bootstrap', 'omnisend_notice' ) );
return;
}
@@ -90,7 +91,7 @@ public static function check_plugin_requirements() {
if ( is_null( $api_key ) ) {
deactivate_plugins( $formidable_addon_plugin );
- add_action( 'admin_notices', array( 'Omnisend_FormidableFormsAddOn_Bootstrap', 'omnisend_woocommerce_api_key_notice' ) );
+ add_action( 'admin_notices', array( 'Omnisend_FormidableFormsAddOn_Bootstrap', 'omnisend_api_key_notice' ) );
return;
}
@@ -101,20 +102,22 @@ public static function check_plugin_requirements() {
deactivate_plugins( $formidable_addon_plugin );
add_action( 'admin_notices', array( 'Omnisend_FormidableFormsAddOn_Bootstrap', 'formidable_forms_notice' ) );
}
+
+ add_action( 'frm_registered_form_actions', array( 'Omnisend_FormidableFormsAddOn_Bootstrap', 'register_actions' ), 10, 1 );
}
/**
- * Display a notice for the missing Omnisend WooCommerce API key.
+ * Display a notice for the missing Omnisend API key.
*/
- public static function omnisend_woocommerce_api_key_notice() {
- echo '
' . esc_html__( 'Your Email Marketing for WooCommerce by Omnisend is not configured properly. Please configure it firstly', 'omnisend-formidable' ) . '
';
+ public static function omnisend_api_key_notice() {
+ echo '' . esc_html__( 'Your Omnisend is not configured properly. Please configure it firstly', 'omnisend-formidable' ) . '
';
}
/**
- * Display a notice for the missing Omnisend For WooCommerce Plugin.
+ * Display a notice for the missing Omnisend Plugin.
*/
- public static function omnisend_woocommerce_notice() {
- echo '';
+ public static function omnisend_notice() {
+ echo '';
}
/**
@@ -128,7 +131,7 @@ public static function formidable_forms_notice() {
* Loading styles in admin.
*/
public static function load_custom_wp_admin_style() {
- wp_register_style( 'omnisend-formidable-forms-addon', plugins_url( 'css/omnisend-formidableforms-addon.css', __FILE__ ), array(), '1.0.0' );
+ wp_register_style( 'omnisend-formidable-forms-addon', plugins_url( 'css/omnisend-formidableforms-addon.css', __FILE__ ), array(), OMNISEND_FORMIDABLE_ADDON_VERSION );
wp_enqueue_style( 'omnisend-formidable-forms-addon' );
}
}
diff --git a/omnisend-for-formidable-forms-add-on/includes/Actions/class-omnisendaddonaction.php b/omnisend-for-formidable-forms-add-on/includes/Actions/class-omnisendaddonaction.php
index de5878b..3cc8b5f 100644
--- a/omnisend-for-formidable-forms-add-on/includes/Actions/class-omnisendaddonaction.php
+++ b/omnisend-for-formidable-forms-add-on/includes/Actions/class-omnisendaddonaction.php
@@ -12,9 +12,6 @@
use FrmFormAction;
use FrmForm;
use FrmEntry;
-use Omnisend\FormidableFormsAddon\Builder\RequestBodyBuilder;
-use Omnisend\FormidableFormsAddon\Mapper\FormFieldsMapper;
-use Omnisend\FormidableFormsAddon\OmnisendResponse;
use Omnisend\FormidableFormsAddon\Provider\OmnisendActionSettingsProvider;
use Omnisend\FormidableFormsAddon\Service\OmnisendApiService;
use Omnisend\FormidableFormsAddon\Service\TrackerService;
@@ -119,19 +116,19 @@ public function process( int $entry_id, int $form_id ): void {
$form_name = FrmForm::getOne( $form_id )->name;
/**
- * Response object for Omnisend.
+ * Response array for tracker.
*
* @var OmnisendResponse $response
*/
$response = $this->omnisend_service->create_omnisend_contact( $form_name, $form_id, $args );
- if ( ! $response->get_success() ) {
+ if ( empty( $response ) ) {
return;
}
$this->tracker_service->enable_web_tracking(
- $response->get_email(),
- $response->get_phone() ?? '',
+ $response[ self::EMAIL ],
+ $response[ self::PHONE_NUMBER ] ?? '',
$this->snippet_path
);
}
diff --git a/omnisend-for-formidable-forms-add-on/includes/Builder/class-requestbodybuilder.php b/omnisend-for-formidable-forms-add-on/includes/Builder/class-requestbodybuilder.php
deleted file mode 100644
index cea06e6..0000000
--- a/omnisend-for-formidable-forms-add-on/includes/Builder/class-requestbodybuilder.php
+++ /dev/null
@@ -1,155 +0,0 @@
- 'formidable-forms-' . $form_name,
- 'createdAt' => gmdate( 'c' ),
- 'ip' => sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) ),
- 'userAgent' => sanitize_text_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ),
- );
-
- $fields_to_process = array(
- OmnisendAddOnAction::EMAIL,
- OmnisendAddOnAction::ADDRESS,
- OmnisendAddOnAction::COUNTRY,
- OmnisendAddOnAction::CITY,
- OmnisendAddOnAction::STATE,
- OmnisendAddOnAction::FIRST_NAME,
- OmnisendAddOnAction::LAST_NAME,
- OmnisendAddOnAction::BIRTHDAY,
- OmnisendAddOnAction::PHONE_NUMBER,
- OmnisendAddOnAction::POSTAL_CODE,
- OmnisendAddOnAction::EMAIL_CONSENT,
- OmnisendAddOnAction::PHONE_CONSENT,
- );
-
- $email = '';
- $phone_number = '';
- $postal_code = '';
- $address = '';
- $country = '';
- $city = '';
- $state = '';
- $first_name = '';
- $last_name = '';
- $birthday = '';
-
- foreach ( $fields_to_process as $field ) {
- if ( isset( $mapped_fields[ $field ] ) && '-1' !== $mapped_fields[ $field ] ) {
- ${$field} = $mapped_fields[ $field ];
- }
- }
-
- if ( empty( $email ) && empty( $phone_number ) ) {
- if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
- error_log( 'Email and phone number are not mapped. Skipping Omnisend contact creation.' );
- }
-
- return array();
- }
-
- $identifiers = array();
- if ( '' !== $email ) {
- $email_identifier = array(
- 'type' => 'email',
- 'channels' => array(
- 'email' => array(
- 'status' => $email_consent,
- 'statusDate' => gmdate( 'c' ),
- ),
- ),
- 'id' => $email,
- );
-
- if ( 'subscribed' === $email_consent ) {
- $email_identifier['consent'] = $consent_object;
- }
- array_push( $identifiers, $email_identifier );
- }
-
- if ( '' !== $phone_number ) {
- $phone_identifier = array(
- 'type' => 'phone',
- 'channels' => array(
- 'sms' => array(
- 'status' => $phone_consent,
- 'statusDate' => gmdate( 'c' ),
- ),
- ),
- 'id' => $phone_number,
- );
- if ( 'subscribed' === $phone_consent ) {
- $phone_identifier['consent'] = $consent_object;
- }
-
- array_push( $identifiers, $phone_identifier );
- }
-
- $data = array( 'identifiers' => $identifiers );
- $fields_to_data_keys = array(
- 'first_name' => 'firstName',
- 'last_name' => 'lastName',
- 'birthday' => 'birthdate',
- 'postal_code' => 'postalCode',
- 'address' => 'address',
- 'state' => 'state',
- 'country' => 'country',
- 'city' => 'city',
- );
-
- foreach ( $fields_to_data_keys as $variable => $data_key ) {
- if ( ! empty( $$variable ) ) {
- $data[ $data_key ] = $$variable;
- }
- }
-
- if ( isset( $mapped_fields['sendWelcomeEmail'] ) ) {
- $data['sendWelcomeEmail'] = $mapped_fields['sendWelcomeEmail'];
- }
-
- $data['tags'] = array( 'formidable_forms', 'formidable_forms ' . $form_name );
-
- if ( ! empty( $mapped_fields['customFields'] ) ) {
- $data['customProperties'] = (object) $mapped_fields['customFields'];
- }
-
- return $data;
- }
-}
diff --git a/omnisend-for-formidable-forms-add-on/includes/Client/class-omnisendapiclient.php b/omnisend-for-formidable-forms-add-on/includes/Client/class-omnisendapiclient.php
deleted file mode 100644
index 4949f34..0000000
--- a/omnisend-for-formidable-forms-add-on/includes/Client/class-omnisendapiclient.php
+++ /dev/null
@@ -1,45 +0,0 @@
- wp_json_encode( $body ),
- 'headers' => array(
- 'Content-Type' => 'application/json',
- 'X-API-Key' => $api_key,
- ),
- 'timeout' => 10,
- );
-
- $response = wp_remote_post( $endpoint, $data );
-
- return $response;
- }
-}
diff --git a/omnisend-for-formidable-forms-add-on/includes/Factory/class-omnisendresponsefactory.php b/omnisend-for-formidable-forms-add-on/includes/Factory/class-omnisendresponsefactory.php
deleted file mode 100644
index 69556cf..0000000
--- a/omnisend-for-formidable-forms-add-on/includes/Factory/class-omnisendresponsefactory.php
+++ /dev/null
@@ -1,47 +0,0 @@
-set_success( $success );
-
- if ( ! empty( $email ) ) {
- $omnisend_response->set_email( $email );
- }
-
- if ( ! empty( $phone ) ) {
- $omnisend_response->set_phone( $phone );
- }
-
- return $omnisend_response;
- }
-}
diff --git a/omnisend-for-formidable-forms-add-on/includes/Mapper/class-contactmapper.php b/omnisend-for-formidable-forms-add-on/includes/Mapper/class-contactmapper.php
new file mode 100644
index 0000000..1e001dc
--- /dev/null
+++ b/omnisend-for-formidable-forms-add-on/includes/Mapper/class-contactmapper.php
@@ -0,0 +1,74 @@
+set_email( $mapped_fields[ OmnisendAddOnAction::EMAIL ] );
+ $contact->set_phone( $mapped_fields[ OmnisendAddOnAction::PHONE_NUMBER ] );
+ $contact->set_first_name( $mapped_fields[ OmnisendAddOnAction::FIRST_NAME ] ?? '' );
+ $contact->set_last_name( $mapped_fields[ OmnisendAddOnAction::LAST_NAME ] ?? '' );
+ $contact->set_birthday( $mapped_fields[ OmnisendAddOnAction::BIRTHDAY ] ?? '' );
+ $contact->set_postal_code( $mapped_fields[ OmnisendAddOnAction::POSTAL_CODE ] ?? '' );
+ $contact->set_address( $mapped_fields[ OmnisendAddOnAction::ADDRESS ] ?? '' );
+ $contact->set_state( $mapped_fields[ OmnisendAddOnAction::STATE ] ?? '' );
+ $contact->set_country( $mapped_fields[ OmnisendAddOnAction::COUNTRY ] ?? '' );
+ $contact->set_city( $mapped_fields[ OmnisendAddOnAction::CITY ] ?? '' );
+
+ if ( isset( $mapped_fields['sendWelcomeEmail'] ) ) {
+ $contact->set_welcome_email( true );
+ }
+
+ if ( isset( $mapped_fields[ OmnisendAddOnAction::EMAIL_CONSENT ] ) ) {
+ $contact->set_email_consent( self::CONSENT_PREFIX . $form_name );
+ $contact->set_email_opt_in( self::CONSENT_PREFIX . $form_name );
+ }
+
+ if ( isset( $mapped_fields[ OmnisendAddOnAction::PHONE_CONSENT ] ) ) {
+ $contact->set_phone_consent( self::CONSENT_PREFIX . $form_name );
+ $contact->set_phone_opt_in( self::CONSENT_PREFIX . $form_name );
+ }
+
+ if ( array_key_exists( self::CUSTOM_FIELDS, $mapped_fields ) ) {
+ foreach ( $mapped_fields[ self::CUSTOM_FIELDS ] as $key => $value ) {
+ $contact->add_custom_property( $key, $value );
+ }
+ }
+
+ $contact->add_tag( self::CUSTOM_PREFIX );
+ $contact->add_tag( self::CUSTOM_PREFIX . ' ' . $form_name );
+
+ return $contact;
+ }
+}
diff --git a/omnisend-for-formidable-forms-add-on/includes/Mapper/class-formfieldsmapper.php b/omnisend-for-formidable-forms-add-on/includes/Mapper/class-formfieldsmapper.php
index 0363833..9f55835 100644
--- a/omnisend-for-formidable-forms-add-on/includes/Mapper/class-formfieldsmapper.php
+++ b/omnisend-for-formidable-forms-add-on/includes/Mapper/class-formfieldsmapper.php
@@ -34,8 +34,8 @@ class FormFieldsMapper {
OmnisendAddOnAction::POSTAL_CODE => 'zip',
);
private const DEFAULT_VALUES = array(
- OmnisendAddOnAction::EMAIL => '',
- OmnisendAddOnAction::PHONE_NUMBER => '',
+ OmnisendAddOnAction::EMAIL => null,
+ OmnisendAddOnAction::PHONE_NUMBER => null,
);
/**
@@ -65,8 +65,6 @@ public function get_field_mappings( int $form_id, array $form_fields ): array {
if ( in_array( $key, $consent_fields, true ) ) {
if ( is_array( $form_fields[ $field_key ] ) ) {
$values[ $key ] = 'subscribed';
- } else {
- $values[ $key ] = 'nonSubscribed';
}
unset( $form_fields[ $field_key ] );
diff --git a/omnisend-for-formidable-forms-add-on/includes/Service/class-omnisendapiservice.php b/omnisend-for-formidable-forms-add-on/includes/Service/class-omnisendapiservice.php
index bb7434f..6c68b06 100644
--- a/omnisend-for-formidable-forms-add-on/includes/Service/class-omnisendapiservice.php
+++ b/omnisend-for-formidable-forms-add-on/includes/Service/class-omnisendapiservice.php
@@ -10,12 +10,10 @@
namespace Omnisend\FormidableFormsAddon\Service;
use Omnisend\FormidableFormsAddon\Actions\OmnisendAddOnAction;
-use Omnisend\FormidableFormsAddon\Builder\RequestBodyBuilder;
-use Omnisend\FormidableFormsAddon\Client\OmnisendApiClient;
-use Omnisend\FormidableFormsAddon\Factory\OmnisendResponseFactory;
use Omnisend\FormidableFormsAddon\Mapper\FormFieldsMapper;
-use Omnisend\FormidableFormsAddon\OmnisendResponse;
+use Omnisend\FormidableFormsAddon\Mapper\ContactMapper;
use Omnisend\FormidableFormsAddon\Validator\ResponseValidator;
+use Omnisend\SDK\V1\Omnisend;
if ( ! defined( 'ABSPATH' ) ) {
exit;
@@ -25,14 +23,6 @@
* Omnisend API Service.
*/
class OmnisendApiService {
-
- /**
- * Omnisend API client.
- *
- * @var OmnisendApiClient
- */
- private $client;
-
/**
* Form fields mapper.
*
@@ -41,35 +31,37 @@ class OmnisendApiService {
private $fields_mapper;
/**
- * Request body builder.
+ * Contact mapper.
*
- * @var RequestBodyBuilder
+ * @var ContactMapper
*/
- private $body_builder;
+ private $contact_mapper;
/**
- * Response factory
+ * Response validator
*
- * @var OmnisendResponseFactory
+ * @var ResponseValidator
*/
- private $response_factory;
+ private $response_validator;
/**
- * Response validator.
+ * Omnisend client
*
- * @var ResponseValidator
+ * @var Omnisend
*/
- private $response_validator;
+ private $client;
/**
* OmnisendApiService class constructor.
*/
public function __construct() {
$this->fields_mapper = new FormFieldsMapper();
- $this->client = new OmnisendApiClient();
- $this->body_builder = new RequestBodyBuilder();
- $this->response_factory = new OmnisendResponseFactory();
+ $this->contact_mapper = new ContactMapper();
$this->response_validator = new ResponseValidator();
+ $this->client = Omnisend::get_client(
+ OMNISEND_FORMIDABLE_ADDON_NAME,
+ OMNISEND_FORMIDABLE_ADDON_VERSION
+ );
}
/**
@@ -79,26 +71,27 @@ public function __construct() {
* @param int $form_id The action settings.
* @param array $form_data The form data.
*
- * @return OmnisendResponse The Omnisend response.
+ * @return array Tracker data.
*/
- public function create_omnisend_contact( string $form_name, int $form_id, array $form_data ): OmnisendResponse {
- $mapped_fields_values = $this->fields_mapper->get_field_mappings( $form_id, $form_data );
- $body = $this->body_builder->get_body( $mapped_fields_values, $form_name );
+ public function create_omnisend_contact( string $form_name, int $form_id, array $form_data ): array {
+ $mapper_fields_values = $this->fields_mapper->get_field_mappings( $form_id, $form_data );
+
+ if ( $mapper_fields_values[ OmnisendAddOnAction::EMAIL ] == null ) {
+ error_log('Omnisend error: email not mapped/submitted'); // phpcs:ignore
- if ( empty( $body ) ) {
- return $this->response_factory->create( false );
+ return array();
}
- $response = $this->client->create_omnisend_contact( $body );
+ $contact = $this->contact_mapper->get_omnisend_contact( $mapper_fields_values, $form_name );
+ $response = $this->client->create_contact( $contact, $form_name );
- if ( ! $this->response_validator->validate_response( $response ) ) {
- return $this->response_factory->create( false );
+ if ( ! $this->response_validator->is_valid( $response ) ) {
+ return array();
}
- return $this->response_factory->create(
- true,
- $mapped_fields_values[ OmnisendAddOnAction::EMAIL ],
- $mapped_fields_values[ OmnisendAddOnAction::PHONE_NUMBER ]
+ return array(
+ OmnisendAddOnAction::EMAIL => $mapper_fields_values[ OmnisendAddOnAction::EMAIL ],
+ OmnisendAddOnAction::PHONE_NUMBER => $mapper_fields_values[ OmnisendAddOnAction::PHONE_NUMBER ],
);
}
}
diff --git a/omnisend-for-formidable-forms-add-on/includes/Service/class-trackerservice.php b/omnisend-for-formidable-forms-add-on/includes/Service/class-trackerservice.php
index 4e48b3e..30f5005 100644
--- a/omnisend-for-formidable-forms-add-on/includes/Service/class-trackerservice.php
+++ b/omnisend-for-formidable-forms-add-on/includes/Service/class-trackerservice.php
@@ -37,13 +37,8 @@ public function enable_web_tracking( string $email, string $phone, string $snipp
)
);
- add_action(
- 'wp_enqueue_scripts',
- function () use ( $identifiers, $snippet_path ) {
- wp_enqueue_script( 'omnisend-snippet-script', $snippet_path, array(), '1.0.0', true );
- wp_localize_script( 'omnisend-snippet-script', 'omnisendIdentifiers', $identifiers );
- },
- 10000
- );
+ wp_enqueue_script( 'jquery' );
+ wp_enqueue_script( 'omnisend-snippet-script', $snippet_path, array(), OMNISEND_FORMIDABLE_ADDON_VERSION, true );
+ wp_localize_script( 'omnisend-snippet-script', 'omnisendIdentifiers', $identifiers );
}
}
diff --git a/omnisend-for-formidable-forms-add-on/includes/Validator/class-responsevalidator.php b/omnisend-for-formidable-forms-add-on/includes/Validator/class-responsevalidator.php
index 5ddb190..1cfa966 100644
--- a/omnisend-for-formidable-forms-add-on/includes/Validator/class-responsevalidator.php
+++ b/omnisend-for-formidable-forms-add-on/includes/Validator/class-responsevalidator.php
@@ -1,6 +1,6 @@
get_error_message() );
- }
+ public function is_valid( CreateContactResponse $response ): bool {
+ if ( ! empty( $response->get_wp_error()->get_error_message() ) ) {
+ error_log( 'Error in after_submission: ' . $response->get_wp_error()->get_error_message()); // phpcs:ignore
return false;
}
- $http_code = wp_remote_retrieve_response_code( $response );
- if ( $http_code >= 400 ) {
- $body = wp_remote_retrieve_body( $response );
- if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
- error_log( "HTTP error: {$http_code} - " . wp_remote_retrieve_response_message( $response ) . " - {$body}" );
- }
-
+ if ( empty( $response->get_contact_id() ) ) {
return false;
}
diff --git a/omnisend-for-formidable-forms-add-on/includes/class-omnisendresponse.php b/omnisend-for-formidable-forms-add-on/includes/class-omnisendresponse.php
deleted file mode 100644
index 1d3db86..0000000
--- a/omnisend-for-formidable-forms-add-on/includes/class-omnisendresponse.php
+++ /dev/null
@@ -1,95 +0,0 @@
-success;
- }
-
- /**
- * Sets if response was successfully sent to Omnisend.
- *
- * @param bool $success The success status of the response.
- */
- public function set_success( $success ) {
- $this->success = $success;
- }
-
- /**
- * Gets the email address.
- *
- * @return string|null
- */
- public function get_email() {
- return $this->email;
- }
-
- /**
- * Sets the email address.
- *
- * @param string $email The email address.
- */
- public function set_email( $email ) {
- $this->email = $email;
- }
-
- /**
- * Gets the phone number.
- *
- * @return string|null
- */
- public function get_phone() {
- return $this->phone;
- }
-
- /**
- * Sets the phone number.
- *
- * @param string $phone The phone number.
- */
- public function set_phone( $phone ) {
- $this->phone = $phone;
- }
-}
diff --git a/omnisend-for-formidable-forms-add-on/js/snippet.js b/omnisend-for-formidable-forms-add-on/js/snippet.js
index 0b0107b..b16f933 100644
--- a/omnisend-for-formidable-forms-add-on/js/snippet.js
+++ b/omnisend-for-formidable-forms-add-on/js/snippet.js
@@ -1,5 +1,19 @@
jQuery(document).ready(function($) {
+ identifyContact(5);
+});
+
+function identifyContact(attempts) {
+ if (attempts <= 0) {
+ return;
+ }
+
if (omnisendIdentifiers && omnisend && omnisend.identifyContact) {
omnisend.identifyContact(omnisendIdentifiers);
+
+ return;
}
-});
+
+ setTimeout(function() {
+ identifyContact(attempts - 1);
+ }, 100);
+}
\ No newline at end of file
diff --git a/omnisend-for-formidable-forms-add-on/readme.txt b/omnisend-for-formidable-forms-add-on/readme.txt
index f3ff17a..edbf3ff 100644
--- a/omnisend-for-formidable-forms-add-on/readme.txt
+++ b/omnisend-for-formidable-forms-add-on/readme.txt
@@ -5,7 +5,7 @@ Tags: formidable forms, form, email marketing, web tracking, subscriber collecti
Requires at least: 4.7.0
Tested up to: 6.4
Requires PHP: 7.1
-Stable tag: 1.0.4
+Stable tag: 1.1.0
License: GPLv3 or later
URI: http://www.gnu.org/licenses/gpl-3.0.html