From 9f39b03d26be2df4063a6e9f66f1059d378a662b Mon Sep 17 00:00:00 2001 From: Gravity Forms Date: Fri, 5 Apr 2019 09:32:03 +0200 Subject: [PATCH] 4.6 --- change_log.txt | 4 + class-gf-mailchimp.php | 395 ++++++++++++++++-- css/form_settings.css | 26 +- css/form_settings.min.css | 2 +- includes/class-gf-mailchimp-api.php | 43 ++ languages/gravityformsmailchimp-ar.mo | Bin 498 -> 498 bytes languages/gravityformsmailchimp-ca.mo | Bin 1540 -> 1540 bytes languages/gravityformsmailchimp-da_DK.mo | Bin 5708 -> 5708 bytes languages/gravityformsmailchimp-de_DE.mo | Bin 5879 -> 5879 bytes .../gravityformsmailchimp-de_DE_formal.mo | Bin 1075 -> 1075 bytes languages/gravityformsmailchimp-en_AU.mo | Bin 5564 -> 5564 bytes languages/gravityformsmailchimp-en_GB.mo | Bin 5570 -> 5570 bytes languages/gravityformsmailchimp-es_ES.mo | Bin 5894 -> 5894 bytes languages/gravityformsmailchimp-fi.mo | Bin 5726 -> 5726 bytes languages/gravityformsmailchimp-fr_CA.mo | Bin 5971 -> 5971 bytes languages/gravityformsmailchimp-fr_FR.mo | Bin 5967 -> 5967 bytes languages/gravityformsmailchimp-hu_HU.mo | Bin 442 -> 442 bytes languages/gravityformsmailchimp-it_IT.mo | Bin 5891 -> 5891 bytes languages/gravityformsmailchimp-ja.mo | Bin 421 -> 421 bytes languages/gravityformsmailchimp-nb_NO.mo | Bin 5552 -> 5552 bytes languages/gravityformsmailchimp-nl_BE.mo | Bin 438 -> 438 bytes languages/gravityformsmailchimp-nl_NL.mo | Bin 5843 -> 5843 bytes languages/gravityformsmailchimp-pt_BR.mo | Bin 6213 -> 5944 bytes languages/gravityformsmailchimp-pt_PT.mo | Bin 5906 -> 5906 bytes languages/gravityformsmailchimp-ru_RU.mo | Bin 7285 -> 7285 bytes languages/gravityformsmailchimp-sv_SE.mo | Bin 439 -> 439 bytes languages/gravityformsmailchimp-zh_CN.mo | Bin 1324 -> 1324 bytes languages/gravityformsmailchimp.pot | 68 ++- mailchimp.php | 4 +- 29 files changed, 493 insertions(+), 49 deletions(-) mode change 100644 => 100755 class-gf-mailchimp.php diff --git a/change_log.txt b/change_log.txt index 0eba52b..90868e5 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,3 +1,7 @@ +# 4.6 | 2019-03-22 + - Added support for Marketing Permissions (GDPR) fields. + + # 4.5 | 2018-12-19 - Fixed new tags not being added when updating existing list member. diff --git a/class-gf-mailchimp.php b/class-gf-mailchimp.php old mode 100644 new mode 100755 index 103c5bd..fc14238 --- a/class-gf-mailchimp.php +++ b/class-gf-mailchimp.php @@ -326,7 +326,7 @@ public function plugin_settings_fields() { */ public function feed_settings_fields() { - return array( + $settings = array( array( 'title' => esc_html__( 'MailChimp Feed Settings', 'gravityformsmailchimp' ), 'fields' => array( @@ -434,6 +434,48 @@ public function feed_settings_fields() { ), ); + // Get currently selected list. + $list = $this->get_setting( 'mailchimpList' ); + + // If a list is selected, get marketing permissions and add setting. + if ( $list ) { + + try { + + // Get MailChimp list, + $list = $this->api->get_list( $list ); + + // If marketing permissions are enabled for list, add setting. + if ( rgar( $list, 'marketing_permissions' ) ) { + + // Prepare setting. + $setting = array( + 'name' => 'marketingPermissions', + 'label' => esc_html__( 'Marketing Permissions', 'gravityformsmailchimp' ), + 'type' => 'marketing_permissions', + 'tooltip' => sprintf( + '
%s
%s', + esc_html__( 'Marketing Permissions', 'gravityformsmailchimp' ), + esc_html__( 'When enabled and conditions are met, users will be opted into your MailChimp list marketing permissions. If a user is already subscribed to your list, they will not be opted out of permissions they are already opted into.', 'gravityformsmailchimp' ) + ), + ); + + // Add setting. + $settings = $this->add_field_after( 'interestCategories', $setting, $settings ); + + } + + } catch ( Exception $e ) { + + // Log that list could not be retrieved. + $this->log_error( __METHOD__ . '(): Unable to add Marketing Permissions field because list could not be retrieved; ' . $e->getMessage() ); + + } + + } + + return $settings; + } /** @@ -688,7 +730,7 @@ public function get_column_value_mailchimp_list_name( $feed ) { * @param array $field The field properties. * @param bool $echo Should the setting markup be echoed. * - * @return string|void + * @return string */ public function settings_interest_categories( $field, $echo = true ) { @@ -698,7 +740,7 @@ public function settings_interest_categories( $field, $echo = true ) { // If no categories are found, return. if ( empty( $categories ) ) { $this->log_debug( __METHOD__ . '(): No categories found.' ); - return; + return ''; } // Start field markup. @@ -815,6 +857,121 @@ public function interest_category_condition( $setting_name_root ) { } + /** + * Define the markup for the Marketing Permissions feed settings field. + * + * @since 4.6 + * @access public + * + * @param array $field The field properties. + * @param bool $echo Should the setting markup be echoed. + * + * @return string + */ + public function settings_marketing_permissions( $field, $echo = true ) { + + // Get current list. + $list = $this->get_setting( 'mailchimpList' ); + + // Get marketing permissions. + $permissions = $this->get_marketing_permissions( $list ); + + // If permissions are not available, display error message. + if ( ! $permissions ) { + + $html = esc_html__( 'You must have at least one list subscriber to configure Marketing Permissions.', 'gravityformsmailchimp' ); + $html .= ' ' . gform_tooltip( esc_html__( "Due to limitations with MailChimp's API, we are only able to get available Marketing Permissions when the selected list has at least one subscriber.", 'gravityformsmailchimp' ), '', true ); + + if ( $echo ) { + echo $html; + } + + return $html; + + } + + // Start field markup. + $html = "
"; + + // Loop through marketing permissions, add conditional logic for each. + foreach ( $permissions as $permission ) { + + // Prepare permission key. + $permission_key = $field['name'] . '_' . $permission['marketing_permission_id']; + + // Open category container. + $html .= '
'; + + // Display toggle checkbox. + $html .= $this->settings_checkbox( + array( + 'name' => esc_html( $permission['marketing_permission_id'] ), + 'type' => 'checkbox', + 'choices' => array( + array( + 'name' => $permission_key . '_enabled', + 'label' => esc_html( $permission['text'] ), + 'class' => 'gaddon-mailchimp-permission-toggle', + 'onclick' => "if(this.checked){jQuery('#{$permission_key}_condition_container').slideDown();} else{jQuery('#{$permission_key}_condition_container').slideUp();}", + ), + ), + ), + false + ); + + // Display condition field for permission. + $html .= $this->marketing_permissions_condition( $permission_key ); + + $html .= '
'; + + } + + $html .= '
'; + + if ( $echo ) { + echo $html; + } + + return $html; + + } + + /** + * Define the markup for the Marketing Permissions conditional logic. + * + * @since 4.6 + * @access public + * + * @param string $setting_name_root The category setting key. + * + * @return string + */ + public function marketing_permissions_condition( $setting_name_root ) { + + $condition_enabled_setting = "{$setting_name_root}_enabled"; + $is_enabled = '1' === $this->get_setting( $condition_enabled_setting ); + $container_style = ! $is_enabled ? "style='display:none;'" : ''; + + $str = sprintf( + '
%s', + $setting_name_root, + $container_style, + $setting_name_root, + esc_html__( 'Enable permission if:', 'gravityformsmailchimp' ) + ); + + + $str .= '
' . + $this->simple_condition( $setting_name_root, $is_enabled ) . + '
' . + + '
'; + + return $str; + + } + + /** * Define which field types can be used for the group conditional logic. * @@ -837,7 +994,11 @@ public function get_conditional_logic_fields() { // Get the current form. $form = $this->get_current_form(); - // Loop through the form fields. + /** + * Loop through the form fields. + * + * @var GF_Field $field + */ foreach ( $form['fields'] as $field ) { // If this field does not support conditional logic, skip it. @@ -1140,7 +1301,7 @@ public function process_feed( $feed, $entry, $form ) { } // Get interest categories. - $categories = $this->get_feed_interest_categories( $feed ); + $categories = $this->get_feed_setting_conditions( $feed ); // Loop through categories. foreach ( $categories as $category_id => $category_meta ) { @@ -1277,6 +1438,51 @@ public function process_feed( $feed, $entry, $form ) { $tag = array( 'name' => $tag, 'status' => 'active' ); } + // Add Marketing Permissions. + if ( $permissions = $this->get_feed_setting_conditions( $feed, 'marketingPermissions' ) ) { + + // If member already exists, only update newly enabled permissions. + if ( $member_found ) { + + // Loop through existing Marketing Permissions, check condition. + foreach ( $member['marketing_permissions'] as $existing_permission ) { + + // If permission is already enabled, keep it that way. + if ( $existing_permission['enabled'] ) { + $subscription['marketing_permissions'][] = $existing_permission; + continue; + } + + // If this permission is not configured, skip. + if ( ! rgar( $permissions, $existing_permission['marketing_permission_id'] ) ) { + continue; + } + + // Check condition and add to subscription. + $subscription['marketing_permissions'][] = array( + 'marketing_permission_id' => $existing_permission['marketing_permission_id'], + 'enabled' => $this->is_marketing_permission_condition_met( $permissions[ $existing_permission['marketing_permission_id'] ], $form, $entry ), + ); + + } + + } else { + + // Loop through permissions, add if enabled. + foreach ( $permissions as $permission_id => $permission ) { + + // Add to subscription. + $subscription['marketing_permissions'][] = array( + 'marketing_permission_id' => $permission_id, + 'enabled' => $this->is_marketing_permission_condition_met( $permission, $form, $entry ), + ); + + } + + } + + } + // Remove note from the subscription object and process any merge tags. $note = GFCommon::replace_variables( $subscription['note'], $form, $entry, false, true, false, 'text' ); unset( $subscription['note'] ); @@ -1512,7 +1718,7 @@ public function maybe_override_field_value( $field_value, $form, $entry, $field_ */ public function initialize_api( $api_key = null ) { - // If API is alredy initialized, return true. + // If API is already initialized, return true. if ( ! is_null( $this->api ) ) { return true; } @@ -1607,6 +1813,103 @@ private function get_interest_categories( $list_id = null ) { } + /** + * Get available marketing permissions for a list. + * + * @since 4.6 + * @access public + * + * @param string $list_id MailChimp List ID. + * + * @return array|bool + */ + private function get_marketing_permissions( $list_id ) { + + $cache_key = 'gravityformsmailchimp_permissions_' . $list_id; + + // Check cache for permissions. + if ( $permissions = GFCache::get( $cache_key ) ) { + return $permissions; + } + + try { + + // Get MailChimp list. + $list = $this->api->get_list( $list_id ); + + } catch ( Exception $e ) { + + // Log that list could not be retrieved. + $this->log_error( __METHOD__ . '(): Unable to get marketing permissions because list could not be retrieved; ' . $e->getMessage() ); + + return false; + + } + + // If marketing permissions are disabled, return. + if ( ! rgar( $list, 'marketing_permissions' ) ) { + return false; + } + + try { + + // Get a list member. + $members = $this->api->get_list_members( $list_id, array( 'count' => 1 ) ); + $member = rgar( $members, 'members' ) ? $members['members'][0] : false; + + + } catch ( Exception $e ) { + + // Log that list could not be retrieved. + $this->log_error( __METHOD__ . '(): Unable to get marketing permissions because list members could not be retrieved; ' . $e->getMessage() ); + + return false; + + } + + // If list has no members, create one. + if ( ! $member ) { + + try { + + // Prepare member parameters. + $member_params = array( + 'email_address' => 'mailchimp@gravityforms.com', + 'status' => 'subscribed', + ); + + // Add member to list. + $member = $this->api->update_list_member( $list_id, $member_params['email_address'], $member_params ); + + // Delete member. + $this->api->delete_list_member( $list_id, $member_params['email_address'] ); + + } catch ( Exception $e ) { + + // Log that we could not create test member. + $this->log_error( __METHOD__ . '(): Unable to create test list member to retrieve marketing permissions; ' . $e->getMessage() ); + + return false; + + } + + } + + // Get marketing permissions from first member. + $permissions = $member['marketing_permissions']; + + // Loop through permissions, remove enabled flag. + foreach ( $permissions as $i => $permission ) { + unset( $permissions[ $i ]['enabled'] ); + } + + // Cache permissions. + GFCache::set( $cache_key, $permissions, true, 5 * MINUTE_IN_SECONDS ); + + return $permissions; + + } + /** * Determines if MailChimp list has any defined interest categories. * @@ -1625,56 +1928,57 @@ public function has_interest_categories() { } /** - * Retrieve the enabled interest categories for a feed. + * Retrieve the enabled conditions for a feed. * + * @since 4.6 Update to be more generic to support marketing permissions. * @since 4.0 - * @access public * - * @param array $feed The feed object. - * @param bool $enabled Return only enabled categories. Defaults to true. + * @param array $feed The feed object. + * @param string $name The feed setting to get conditions for. + * @param bool $enabled Return only enabled categories. Defaults to true. * * @return array */ - public function get_feed_interest_categories( $feed, $enabled = true ) { + public function get_feed_setting_conditions( $feed, $name = 'interestCategory', $enabled = true ) { - // Initialize categories array. - $categories = array(); + // Initialize conditions array. + $conditions = array(); // Loop through feed meta. foreach ( $feed['meta'] as $key => $value ) { - // If this is not an interest category, skip it. - if ( 0 !== strpos( $key, 'interestCategory_' ) ) { + // If this is not the setting we're looking for, skip. + if ( 0 !== strpos( $key, $name . '_' ) ) { continue; } // Explode the meta key. $key = explode( '_', $key ); - // Add value to categories array. - $categories[ $key[1] ][ $key[2] ] = $value; + // Add value to conditions array. + $conditions[ $key[1] ][ $key[2] ] = $value; } - // If we are only returning enabled categories, remove disabled categories. + // If we are only returning enabled conditions, remove disabled conditions. if ( $enabled ) { - // Loop through categories. - foreach ( $categories as $category_id => $category_meta ) { + // Loop through conditions. + foreach ( $conditions as $condition_id => $condition_meta ) { - // If category is enabled, skip it. - if ( '1' == $category_meta['enabled'] ) { + // If condition is enabled, skip it. + if ( '1' == $condition_meta['enabled'] ) { continue; } - // Remove category. - unset( $categories[ $category_id ] ); + // Remove condition. + unset( $conditions[ $condition_id ] ); } } - return $categories; + return $conditions; } @@ -1731,6 +2035,47 @@ public function is_category_condition_met( $category, $form, $entry ) { } + + /** + * Determine if the Marketing Permission should be enabled for user. + * + * @since 4.6 + * @access public + * + * @param array $permission The Marketing Permission properties. + * @param array $form The form currently being processed. + * @param array $entry The entry currently being processed. + * + * @return bool + */ + public function is_marketing_permission_condition_met( $permission, $form, $entry ) { + + if ( ! $permission['enabled'] ) { + $this->log_debug( __METHOD__ . '(): Marketing Permission not enabled. Returning false.' ); + return false; + } + + // Get field. + $field = GFFormsModel::get_field( $form, $permission['field'] ); + + if ( ! is_object( $field ) ) { + + $this->log_debug( __METHOD__ . "(): Field #{$permission['field']} not found. Returning true." ); + return true; + + } else { + + $field_value = GFFormsModel::get_lead_field_value( $entry, $field ); + $is_value_match = GFFormsModel::is_value_match( $field_value, $permission['value'], $permission['operator'] ); + + $this->log_debug( __METHOD__ . "(): Enable Marketing Permission if field #{$permission['field']} value {$permission['operator']} '{$permission['value']}'. Is value match? " . var_export( $is_value_match, 1 ) ); + + return $is_value_match; + + } + + } + /** * Returns the combined value of the specified Address field. * Street 2 and Country are the only inputs not required by MailChimp. diff --git a/css/form_settings.css b/css/form_settings.css index 8f21764..834de36 100644 --- a/css/form_settings.css +++ b/css/form_settings.css @@ -6,9 +6,33 @@ margin: 5px 0 0 0; } -.gaddon-mailchimp-category .gf_animate_sub_settings { +.gaddon-mailchimp-permission-toggle { + margin-bottom: 5px; +} + +.gaddon-mailchimp-category .gf_animate_sub_settings, +.gaddon-mailchimp-permission .gf_animate_sub_settings { padding-left: 10px; } + +.gaddon-mailchimp-permission:not( :first-child ) { + margin-top: 5px; +} + +.gaddon-mailchimp-permission .gaddon-setting-checkbox:first-child { + margin-top: 0; +} + +.gaddon-mailchimp-permission .condition_container { + margin-bottom: 10px; + margin-top: 5px; +} + +.gaddon-mailchimp-permission .condition_label { + display: inline-block; + margin-bottom: 5px; +} + .gaddon-mailchimp-category { padding-bottom: 12px; } diff --git a/css/form_settings.min.css b/css/form_settings.min.css index 3cb42c9..1413e5c 100644 --- a/css/form_settings.min.css +++ b/css/form_settings.min.css @@ -1 +1 @@ -.gaddon-mailchimp-categoryname{font-weight:700}.gaddon-setting-checkbox{margin:5px 0 0}.gaddon-mailchimp-category .gf_animate_sub_settings{padding-left:10px}.gaddon-mailchimp-category{padding-bottom:12px} \ No newline at end of file +.gaddon-mailchimp-categoryname{font-weight:700}.gaddon-setting-checkbox{margin:5px 0 0}.gaddon-mailchimp-permission-toggle{margin-bottom:5px}.gaddon-mailchimp-category .gf_animate_sub_settings,.gaddon-mailchimp-permission .gf_animate_sub_settings{padding-left:10px}.gaddon-mailchimp-permission:not( :first-child ){margin-top:5px}.gaddon-mailchimp-permission .gaddon-setting-checkbox:first-child{margin-top:0}.gaddon-mailchimp-permission .condition_container{margin-bottom:10px;margin-top:5px}.gaddon-mailchimp-permission .condition_label{display:inline-block;margin-bottom:5px}.gaddon-mailchimp-category{padding-bottom:12px} \ No newline at end of file diff --git a/includes/class-gf-mailchimp-api.php b/includes/class-gf-mailchimp-api.php index c2db7e8..22250a7 100644 --- a/includes/class-gf-mailchimp-api.php +++ b/includes/class-gf-mailchimp-api.php @@ -65,6 +65,29 @@ public function account_details() { } + /** + * Delete a specific MailChimp list member. + * + * @since 4.6 + * @access public + * + * @param string $list_id MailChimp list ID. + * @param string $email_address Email address. + * + * @uses GF_MailChimp_API::process_request() + * + * @return array + * @throws GF_MailChimp_Exception|Exception + */ + public function delete_list_member( $list_id, $email_address ) { + + // Prepare subscriber hash. + $subscriber_hash = md5( strtolower( $email_address ) ); + + return $this->process_request( 'lists/' . $list_id . '/members/' . $subscriber_hash, array(), 'DELETE' ); + + } + /** * Get all interests for an interest category. * @@ -165,6 +188,26 @@ public function get_list_member( $list_id, $email_address ) { } + /** + * Get MailChimp list members. + * + * @since 4.6 + * @access public + * + * @param string $list_id MailChimp list ID. + * @param array $options Additional settings. + * + * @uses GF_MailChimp_API::process_request() + * + * @return array + * @throws GF_MailChimp_Exception|Exception + */ + public function get_list_members( $list_id, $options = array() ) { + + return $this->process_request( 'lists/' . $list_id . '/members', $options ); + + } + /** * Get all merge fields for a MailChimp list. * diff --git a/languages/gravityformsmailchimp-ar.mo b/languages/gravityformsmailchimp-ar.mo index 2ccd3b16fae16399d71943f51b0604b65808083c..e783813d364ea9aca99a2ec9db1183e099a9146f 100644 GIT binary patch delta 24 fcmeyw{E2zOdR`-4LrVoiV=EIgD?`JLd(0RCW?2Vl delta 24 fcmeyw{E2zOdR_xvBTEHCODiJ_D`T^bd(0RCW~&Eu diff --git a/languages/gravityformsmailchimp-ca.mo b/languages/gravityformsmailchimp-ca.mo index 8434a6128123a82f4b2e57971d250759bf07b55d..adec6eb322840d1e5b1b663d487e35182c400461 100644 GIT binary patch delta 26 hcmZqSY2n%6&cth^YiOxpXl!L-W@Tu&IfQ8gGXPeu25TnU$g8<}~hSTmWst2eSYG delta 26 hcmX@3b4F)FBsZ^tu92mJp{13Pg_W_{<}~hSTmWt$2fqLS diff --git a/languages/gravityformsmailchimp-de_DE.mo b/languages/gravityformsmailchimp-de_DE.mo index e42ef5de021e725224b10a439f636a6d36486644..4ada61b31236db42d52256ef2507e37d7e4c8c85 100644 GIT binary patch delta 26 hcmeya`(1ZKBsZ^-uA!xZp|O>TnU$g8<}~h!+yHg22e$wK delta 26 hcmeya`(1ZKBsZ^tu92mJp{13Pg_W_{<}~h!+yHhB2g3jW diff --git a/languages/gravityformsmailchimp-de_DE_formal.mo b/languages/gravityformsmailchimp-de_DE_formal.mo index a963d678ab94990a2030ea029db1ffe6f66e1d08..efe727f00cfce6bd0c58472dff9722ac6d8da444 100644 GIT binary patch delta 26 hcmdnYv6*9o9wV=juA!xZp|O>TnU$g8W^2YDOaNUY2H5}r delta 26 hcmdnYv6*9o9wV=Tu92mJp{13Pg_W_{W^2YDOaNVh2IT+% diff --git a/languages/gravityformsmailchimp-en_AU.mo b/languages/gravityformsmailchimp-en_AU.mo index c081761efa7335e444aad1b3b34bc9e0ae143aeb..eaaa1f809963fbdca5d1f1cc761ef268ee29f72c 100644 GIT binary patch delta 26 hcmdm^y+?aPBsZ^-uA!xZp|O>TnU$g8<}~gwE&yp#2LS*8 delta 26 hcmdm^y+?aPBsZ^tu92mJp{13Pg_W_{<}~gwE&yq;2MquK diff --git a/languages/gravityformsmailchimp-en_GB.mo b/languages/gravityformsmailchimp-en_GB.mo index b1a4c4641e43cecf60234354eb6886487ef7716c..98a957d2f637945af60078d041f5d896c0ca8120 100644 GIT binary patch delta 26 hcmX@4eMoylBsZ^-uA!xZp|O>TnU$g8<}~gYE&ytZ2NM7Q delta 26 hcmX@4eMoylBsZ^tu92mJp{13Pg_W_{<}~gYE&yui2Oj_c diff --git a/languages/gravityformsmailchimp-es_ES.mo b/languages/gravityformsmailchimp-es_ES.mo index de6ea066e2610c72430e855e9fb070a5f122268f..32c1d8b1393a46d58053a8c1800147a68bc9e1ab 100644 GIT binary patch delta 26 hcmZqEYt!2h$<1q|YiOxpXl!L-W@Tu&IgNV(HvnJj2Ic?& delta 26 hcmZqEYt!2h$<1q^YhTnU$g8<}~gfTmW%u2k8I+ delta 26 hcmcbob5CbOBsZ^tu92mJp{13Pg_W_{<}~gfTmW&%2lW5| diff --git a/languages/gravityformsmailchimp-fr_CA.mo b/languages/gravityformsmailchimp-fr_CA.mo index 3bd01e6fde4b39cdeb92dc36412cdf5a61bc528c..410da29accedd78b27aab3218b69f8cf2d9582bd 100644 GIT binary patch delta 26 hcmcbtcUf;kBsZ^-uA!xZp|O>TnU$g8<}~iN+yHNn2h9Kg delta 26 hcmcbtcUf;kBsZ^tu92mJp{13Pg_W_{<}~iN+yHOw2iX7s diff --git a/languages/gravityformsmailchimp-fr_FR.mo b/languages/gravityformsmailchimp-fr_FR.mo index affc5f7ef407894d81fad357efca22d7fec8178c..6c5988c74357d788d7b52f210413eaff8ce3027d 100644 GIT binary patch delta 26 hcmX@FcV2HpBsZ^-uA!xZp|O>TnU$g8<}~h?+yHLB2f+XU delta 26 hcmX@FcV2HpBsZ^tu92mJp{13Pg_W_{<}~h?+yHMK2h9Kg diff --git a/languages/gravityformsmailchimp-hu_HU.mo b/languages/gravityformsmailchimp-hu_HU.mo index d603663865a94b66a7fc62f5660eb64f3c368f8f..38445d3951858eb011041bd6eb1bb490b2003fc9 100644 GIT binary patch delta 23 fcmdnRyo-6ldR`-4LrVoiV=EIgD?`JHd;S3cRk;VB delta 23 fcmdnRyo-6ldR_xvBTEHCODiJ_D`T^Xd;S3cRsRR8 diff --git a/languages/gravityformsmailchimp-it_IT.mo b/languages/gravityformsmailchimp-it_IT.mo index c27811e742e1dd3c93e003a4e31d8bfb6267409f..0e6f0314266fd0c6bacba7938305c6a33f794e4d 100644 GIT binary patch delta 26 hcmZqHYu4Kk$<1q|YiOxpXl!L-W@Tu&IgNWRHvnHx2HgMv delta 26 hcmZqHYu4Kk$<1q^Yhy+L~eKR2(DuA!xZp|O>TnU$g8W*P1&TmWD^29p2) delta 26 hcmdm>y+L~eKR2&|u92mJp{13Pg_W_{W*P1&TmWF22A==` diff --git a/languages/gravityformsmailchimp-nl_BE.mo b/languages/gravityformsmailchimp-nl_BE.mo index 63bd48163512cc0eb24fe95fab2dde5c9d0913f4..08283c58b2ba4672a0519577585557f498de1755 100644 GIT binary patch delta 23 fcmdnSyp4IndR`-4LrVoiV=EIgD?`JHdwu}`RRsr= delta 23 fcmdnSyp4IndR_xvBTEHCODiJ_D`T^Xdwu}`RZ9n- diff --git a/languages/gravityformsmailchimp-nl_NL.mo b/languages/gravityformsmailchimp-nl_NL.mo index 752c9fc589c0dc881a40ee594fa1869d8eb5d8c5..557357450cb5f3bafb1311dd7014da067cf6f6eb 100644 GIT binary patch delta 26 hcmcbtds%lwBsZ^-uA!xZp|O>TnU$g8<}~hHZUAmy2TK3| delta 26 hcmcbtds%lwBsZ^tu92mJp{13Pg_W_{<}~hHZUAn*2Uh?9 diff --git a/languages/gravityformsmailchimp-pt_BR.mo b/languages/gravityformsmailchimp-pt_BR.mo index 853b52f622912410ed1d3499a80d590ecef2fd7c..ef6f2bc859a4d4067952386897dc3ffeafa16ff4 100644 GIT binary patch delta 889 zcmXxiPe@cz6vy$SGp42E-<&ivXH1)gH2TI-amXkU{~!p0t=v?&5p-eXqK#uBf}n1O zqBae*8fcY+GK&O}Gy~C zpJ%4MYH=C^sD(b@9ZX>{Zeka~9pEkIzI-!3Rv~LyGnQa9JMTe$Ho!&e4C6B##~6M^ zFZZZ*7@socIiYbs%*MtP>rVZRvN=oiFJ)@ed=>!V0j;{K0IJbQDsBB)h z8U_khnIL{Eq~E1eZL$^ON^79&qzZ;0-KJXsx<1BW!tvAuDX81@{VHGjzEuD|2sg2f piAm3Ldcr%O?~6QgIs;B?EZQD(oWy0}Tuw)Nw&;6q`e(^Z!9O8+QT6}; delta 1141 zcmZwFUr19?9Ki9Tv$U30tJJhVXZyPQ55x7JzU*w4tBkB_s(TOQV#}& z2#ugJ5PFCpq(qV)f+8`f9wn-W@};+4>Lnin>HFJO5OmnNpZ(bG`TfrCoM(aghLJD6 zf?JAF&D_E~o2OJW-pl8~h+vf#;ZH2a+7($t z*ht)s+msqn!+eniZ=>X##3bHFS*V;J%di$punRjV@+7V%9xqg?6z?Lr)HJTe*(gx|1@{Hnev`(i)t;s*hk|2`p0t6!L)gI*u`q@|bnS2>QMwD19L#z(n$9@)Hli(7F4kKzwJ zf*n*V?~P&*Z(s|)#51^rJ$P!9QtxpB-{4>=`+dcib`C~bxSX?+YNUlBq|nR-gv>dL zT#d|-izPeX!IXkI5v7^388(?YPB}{Q{T-4=ilupUXJ0l^C4uaaLNjAGPi|*sw{p2; zR5PWGbWN3|{hmrc2b&q&c~&r`mvR7dEv3;_>2sd3h-*X~?b>?SPA2p*BN{v0AGPAT z&mM4%KG)HysN1g%V#_kLW5$hy;hJF`i#l#VSDS%IKo6KH9W#w^o$g5(Ls55FciRce zsnaR5S39iRXV%Otdd3Tj8|oWd_1@OD#!y>ROZt-cYF=n&+50?y#GnQ##IPNbB%N%2 zmndxiQTnU$g8<}~g#+yG)*2MPcH delta 26 hcmbQFH%V_pBsZ^tu92mJp{13Pg_W_{<}~g#+yG*^2NnPT diff --git a/languages/gravityformsmailchimp-ru_RU.mo b/languages/gravityformsmailchimp-ru_RU.mo index 8d1c3cea02ecf751fa25856f88b2a8af16b873cc..8924a6d0060759269f7c8789202bf5c41368aee5 100644 GIT binary patch delta 26 hcmexr@zr8OBsZ^-uA!xZp|O>TnU$g8<}_}8K>&7L2TcF~ delta 26 hcmexr@zr8OBsZ^tu92mJp{13Pg_W_{<}_}8K>&8U2U!3B diff --git a/languages/gravityformsmailchimp-sv_SE.mo b/languages/gravityformsmailchimp-sv_SE.mo index fe09307576903b686b4df463a1b2dc14b46a3c96..88486c7cd9cdea2942a50899355223ddf343fadf 100644 GIT binary patch delta 23 fcmdnayq$T%dR`-4LrVoiV=EIgD?`JHdwv4|RWb*b delta 23 fcmdnayq$T%dR_xvBTEHCODiJ_D`T^Xdwv4|Rd@%Y diff --git a/languages/gravityformsmailchimp-zh_CN.mo b/languages/gravityformsmailchimp-zh_CN.mo index 2a9db2bbffab6440abd024c7ab6179faf74d5aaf..402dca6fc04b2ba03fae801186b8d83fe6e1ff74 100644 GIT binary patch delta 26 hcmZ3(wT5fM6-HhoT|-L+Lt`rwGb=;G%?}y9nE`782X6oX delta 26 hcmZ3(wT5fM6-HhIT_Z~cLrW_o3oB!@%?}y9nE`8H2YUbj diff --git a/languages/gravityformsmailchimp.pot b/languages/gravityformsmailchimp.pot index c12316d..77a24b4 100644 --- a/languages/gravityformsmailchimp.pot +++ b/languages/gravityformsmailchimp.pot @@ -1,13 +1,13 @@ -# Copyright 2009-2018 Rocketgenius, Inc. +# Copyright 2009-2019 Rocketgenius, Inc. msgid "" msgstr "" -"Project-Id-Version: Gravity Forms MailChimp Add-On 4.5\n" +"Project-Id-Version: Gravity Forms MailChimp Add-On 4.6\n" "Report-Msgid-Bugs-To: https://www.gravtiyforms.com\n" -"POT-Creation-Date: 2018-12-19 13:46:11+00:00\n" +"POT-Creation-Date: 2019-03-22 14:18:33+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"PO-Revision-Date: 2018-MO-DA HO:MI+ZONE\n" +"PO-Revision-Date: 2019-MO-DA HO:MI+ZONE\n" "Last-Translator: Rocketgenius \n" "Language-Team: Rocketgenius \n" "X-Generator: Gravity Forms Build Server\n" @@ -46,7 +46,7 @@ msgid "MailChimp Feed Settings" msgstr "" #: class-gf-mailchimp.php:335 class-gf-mailchimp.php:341 -#: class-gf-mailchimp.php:639 +#: class-gf-mailchimp.php:681 msgid "Name" msgstr "" @@ -55,7 +55,7 @@ msgid "Enter a feed name to uniquely identify this setup." msgstr "" #: class-gf-mailchimp.php:347 class-gf-mailchimp.php:352 -#: class-gf-mailchimp.php:640 +#: class-gf-mailchimp.php:682 msgid "MailChimp List" msgstr "" @@ -129,59 +129,87 @@ msgid "" "submissions will be exported." msgstr "" -#: class-gf-mailchimp.php:492 class-gf-mailchimp.php:505 +#: class-gf-mailchimp.php:454 class-gf-mailchimp.php:458 +msgid "Marketing Permissions" +msgstr "" + +#: class-gf-mailchimp.php:459 +msgid "" +"When enabled and conditions are met, users will be opted into your " +"MailChimp list marketing permissions. If a user is already subscribed to " +"your list, they will not be opted out of permissions they are already opted " +"into." +msgstr "" + +#: class-gf-mailchimp.php:534 class-gf-mailchimp.php:547 msgid "Could not load MailChimp contact lists. %sError: %s" msgstr "" -#: class-gf-mailchimp.php:505 +#: class-gf-mailchimp.php:547 msgid "No lists found." msgstr "" -#: class-gf-mailchimp.php:517 +#: class-gf-mailchimp.php:559 msgid "Select a MailChimp List" msgstr "" -#: class-gf-mailchimp.php:563 +#: class-gf-mailchimp.php:605 msgid "Email Address" msgstr "" -#: class-gf-mailchimp.php:781 +#: class-gf-mailchimp.php:823 msgid "Assign to group:" msgstr "" -#: class-gf-mailchimp.php:790 +#: class-gf-mailchimp.php:832 msgid "Always" msgstr "" -#: class-gf-mailchimp.php:794 +#: class-gf-mailchimp.php:836 msgid "If" msgstr "" -#: class-gf-mailchimp.php:908 +#: class-gf-mailchimp.php:882 +msgid "" +"You must have at least one list subscriber to configure Marketing " +"Permissions." +msgstr "" + +#: class-gf-mailchimp.php:883 +msgid "" +"Due to limitations with MailChimp's API, we are only able to get available " +"Marketing Permissions when the selected list has at least one subscriber." +msgstr "" + +#: class-gf-mailchimp.php:960 +msgid "Enable permission if:" +msgstr "" + +#: class-gf-mailchimp.php:1069 msgid "Abusing this may cause your MailChimp account to be suspended." msgstr "" -#: class-gf-mailchimp.php:939 +#: class-gf-mailchimp.php:1100 msgid "Unable to process feed because API could not be initialized." msgstr "" -#: class-gf-mailchimp.php:954 +#: class-gf-mailchimp.php:1115 msgid "A valid Email address must be provided." msgstr "" -#: class-gf-mailchimp.php:1068 +#: class-gf-mailchimp.php:1229 msgid "Unable to check if email address is already used by a member: %s" msgstr "" -#: class-gf-mailchimp.php:1300 +#: class-gf-mailchimp.php:1506 msgid "Unable to add/update subscriber: %s" msgstr "" -#: class-gf-mailchimp.php:1325 +#: class-gf-mailchimp.php:1531 msgid "Unable to add/update subscriber tags: %s" msgstr "" -#: class-gf-mailchimp.php:1343 +#: class-gf-mailchimp.php:1549 msgid "Unable to add note to subscriber: %s" msgstr "" diff --git a/mailchimp.php b/mailchimp.php index 570cd37..a3f7271 100644 --- a/mailchimp.php +++ b/mailchimp.php @@ -9,7 +9,7 @@ Plugin Name: Gravity Forms MailChimp Add-On Plugin URI: https://www.gravityforms.com Description: Integrates Gravity Forms with MailChimp, allowing form submissions to be automatically sent to your MailChimp account -Version: 4.5 +Version: 4.6 Author: rocketgenius Author URI: https://www.rocketgenius.com License: GPL-2.0+ @@ -34,7 +34,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA **/ -define( 'GF_MAILCHIMP_VERSION', '4.5' ); +define( 'GF_MAILCHIMP_VERSION', '4.6' ); // If Gravity Forms is loaded, bootstrap the Mailchimp Add-On. add_action( 'gform_loaded', array( 'GF_MailChimp_Bootstrap', 'load' ), 5 );