diff --git a/change_log.txt b/change_log.txt index 05b0639..2601b05 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,8 @@ -4.3 | 2018-03-27 +# 4.4 | 2018-10-29 + - Added support for MailChimp contact tags. + + +# 4.3 | 2018-03-27 - Added security enhancements. - Added GPL to plugin header. - Updated API library to public property in support of MailChimp block. diff --git a/class-gf-mailchimp.php b/class-gf-mailchimp.php index bfca2fe..0e225f4 100644 --- a/class-gf-mailchimp.php +++ b/class-gf-mailchimp.php @@ -402,6 +402,17 @@ public function feed_settings_fields() { ), ), ), + array( + 'name' => 'tags', + 'type' => 'text', + 'class' => 'medium merge-tag-support mt-position-right mt-hide_all_fields', + 'label' => esc_html__( 'Tags', 'gravityformsmailchimp' ), + 'tooltip' => sprintf( + '
%s
%s', + esc_html__( 'Tags', 'gravityformsmailchimp' ), + esc_html__( 'Associate tags to your MailChimp contacts with a comma separated list. (e.g. new lead, Gravity Forms, web source)', 'gravityformsmailchimp' ) + ), + ), array( 'name' => 'note', 'type' => 'textarea', @@ -1150,6 +1161,24 @@ public function process_feed( $feed, $entry, $form ) { } + // Get tags. + $tags = explode(',', rgars( $feed, 'meta/tags' ) ); + $tags = array_map( 'trim', $tags ); + + // Prepare tags. + if ( ! empty( $tags ) ) { + + // Loop through tags, replace merge tags. + foreach ( $tags as &$tag ) { + $tag = GFCommon::replace_variables( $tag, $form, $entry, false, false, false, 'text' ); + $tag = trim( $tag ); + } + + // Remove empty tags. + $tags = array_filter( $tags ); + + } + // If member status is not defined or is anything other than pending, set to subscribed. $member_status = isset( $member_status ) && $member_status === 'pending' ? $member_status : 'subscribed'; @@ -1167,6 +1196,11 @@ public function process_feed( $feed, $entry, $form ) { 'note' => rgars( $feed, 'meta/note' ), ); + // Add tags to subscription. + if ( ! empty( $tags ) ) { + $subscription['tags'] = $tags; + } + // Prepare transaction type for filter. $transaction = $member_found ? 'Update' : 'Subscribe'; diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..6f2db09 --- /dev/null +++ b/composer.json @@ -0,0 +1,9 @@ +{ + "name": "wp-premium/gravityformsmailchimp", + "type": "wordpress-plugin", + "autoload": { + "classmap": [ + "." + ] + } +} \ No newline at end of file diff --git a/css/form_settings.css b/css/form_settings.css index b33e6e6..8f21764 100644 --- a/css/form_settings.css +++ b/css/form_settings.css @@ -9,3 +9,6 @@ .gaddon-mailchimp-category .gf_animate_sub_settings { padding-left: 10px; } +.gaddon-mailchimp-category { + padding-bottom: 12px; +} diff --git a/css/form_settings.min.css b/css/form_settings.min.css index f480c5b..3cb42c9 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} \ No newline at end of file +.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 diff --git a/languages/gravityformsmailchimp-ar.mo b/languages/gravityformsmailchimp-ar.mo new file mode 100644 index 0000000..e80bbee Binary files /dev/null and b/languages/gravityformsmailchimp-ar.mo differ diff --git a/languages/gravityformsmailchimp-ca.mo b/languages/gravityformsmailchimp-ca.mo index 6d7a0b0..a96352f 100644 Binary files a/languages/gravityformsmailchimp-ca.mo and b/languages/gravityformsmailchimp-ca.mo differ diff --git a/languages/gravityformsmailchimp-da_DK.mo b/languages/gravityformsmailchimp-da_DK.mo index 89f587e..0dd166d 100644 Binary files a/languages/gravityformsmailchimp-da_DK.mo and b/languages/gravityformsmailchimp-da_DK.mo differ diff --git a/languages/gravityformsmailchimp-de_DE.mo b/languages/gravityformsmailchimp-de_DE.mo index 87783b7..3dcb490 100644 Binary files a/languages/gravityformsmailchimp-de_DE.mo and b/languages/gravityformsmailchimp-de_DE.mo differ diff --git a/languages/gravityformsmailchimp-de_DE_formal.mo b/languages/gravityformsmailchimp-de_DE_formal.mo index 78217da..e83197e 100644 Binary files a/languages/gravityformsmailchimp-de_DE_formal.mo and b/languages/gravityformsmailchimp-de_DE_formal.mo differ diff --git a/languages/gravityformsmailchimp-en.mo b/languages/gravityformsmailchimp-en.mo deleted file mode 100644 index 8c9e8a7..0000000 Binary files a/languages/gravityformsmailchimp-en.mo and /dev/null differ diff --git a/languages/gravityformsmailchimp-en_AU.mo b/languages/gravityformsmailchimp-en_AU.mo index 87987ad..dbe1b86 100644 Binary files a/languages/gravityformsmailchimp-en_AU.mo and b/languages/gravityformsmailchimp-en_AU.mo differ diff --git a/languages/gravityformsmailchimp-en_GB.mo b/languages/gravityformsmailchimp-en_GB.mo index 89a9204..90edf93 100644 Binary files a/languages/gravityformsmailchimp-en_GB.mo and b/languages/gravityformsmailchimp-en_GB.mo differ diff --git a/languages/gravityformsmailchimp-es_ES.mo b/languages/gravityformsmailchimp-es_ES.mo index 0b54130..c28ead5 100644 Binary files a/languages/gravityformsmailchimp-es_ES.mo and b/languages/gravityformsmailchimp-es_ES.mo differ diff --git a/languages/gravityformsmailchimp-fi.mo b/languages/gravityformsmailchimp-fi.mo index 9f1b567..1e93462 100644 Binary files a/languages/gravityformsmailchimp-fi.mo and b/languages/gravityformsmailchimp-fi.mo differ diff --git a/languages/gravityformsmailchimp-fr_CA.mo b/languages/gravityformsmailchimp-fr_CA.mo index 40327c6..0999949 100644 Binary files a/languages/gravityformsmailchimp-fr_CA.mo and b/languages/gravityformsmailchimp-fr_CA.mo differ diff --git a/languages/gravityformsmailchimp-fr_FR.mo b/languages/gravityformsmailchimp-fr_FR.mo index 52e9f33..f647049 100644 Binary files a/languages/gravityformsmailchimp-fr_FR.mo and b/languages/gravityformsmailchimp-fr_FR.mo differ diff --git a/languages/gravityformsmailchimp-hu_HU.mo b/languages/gravityformsmailchimp-hu_HU.mo new file mode 100644 index 0000000..ea706db Binary files /dev/null and b/languages/gravityformsmailchimp-hu_HU.mo differ diff --git a/languages/gravityformsmailchimp-it_IT.mo b/languages/gravityformsmailchimp-it_IT.mo index 3c486d5..5cd2e12 100644 Binary files a/languages/gravityformsmailchimp-it_IT.mo and b/languages/gravityformsmailchimp-it_IT.mo differ diff --git a/languages/gravityformsmailchimp-ja.mo b/languages/gravityformsmailchimp-ja.mo new file mode 100644 index 0000000..8744f82 Binary files /dev/null and b/languages/gravityformsmailchimp-ja.mo differ diff --git a/languages/gravityformsmailchimp-nb_NO.mo b/languages/gravityformsmailchimp-nb_NO.mo index 35c0d20..f3f42b5 100644 Binary files a/languages/gravityformsmailchimp-nb_NO.mo and b/languages/gravityformsmailchimp-nb_NO.mo differ diff --git a/languages/gravityformsmailchimp-nl_BE.mo b/languages/gravityformsmailchimp-nl_BE.mo new file mode 100644 index 0000000..36e7c93 Binary files /dev/null and b/languages/gravityformsmailchimp-nl_BE.mo differ diff --git a/languages/gravityformsmailchimp-nl_NL.mo b/languages/gravityformsmailchimp-nl_NL.mo index af1e9c1..3664839 100644 Binary files a/languages/gravityformsmailchimp-nl_NL.mo and b/languages/gravityformsmailchimp-nl_NL.mo differ diff --git a/languages/gravityformsmailchimp-pt_BR.mo b/languages/gravityformsmailchimp-pt_BR.mo index 3fb7587..4df5a4c 100644 Binary files a/languages/gravityformsmailchimp-pt_BR.mo and b/languages/gravityformsmailchimp-pt_BR.mo differ diff --git a/languages/gravityformsmailchimp-pt_PT.mo b/languages/gravityformsmailchimp-pt_PT.mo index cc651db..800efe7 100644 Binary files a/languages/gravityformsmailchimp-pt_PT.mo and b/languages/gravityformsmailchimp-pt_PT.mo differ diff --git a/languages/gravityformsmailchimp-ru_RU.mo b/languages/gravityformsmailchimp-ru_RU.mo index 0201ceb..3eb08ae 100644 Binary files a/languages/gravityformsmailchimp-ru_RU.mo and b/languages/gravityformsmailchimp-ru_RU.mo differ diff --git a/languages/gravityformsmailchimp-sv_SE.mo b/languages/gravityformsmailchimp-sv_SE.mo new file mode 100644 index 0000000..fc5f0cb Binary files /dev/null and b/languages/gravityformsmailchimp-sv_SE.mo differ diff --git a/languages/gravityformsmailchimp-zh_CN.mo b/languages/gravityformsmailchimp-zh_CN.mo index 5a4e5f2..9644b4d 100644 Binary files a/languages/gravityformsmailchimp-zh_CN.mo and b/languages/gravityformsmailchimp-zh_CN.mo differ diff --git a/languages/gravityformsmailchimp.pot b/languages/gravityformsmailchimp.pot index 280f538..bfe03c0 100644 --- a/languages/gravityformsmailchimp.pot +++ b/languages/gravityformsmailchimp.pot @@ -1,9 +1,9 @@ # Copyright 2009-2018 Rocketgenius, Inc. msgid "" msgstr "" -"Project-Id-Version: Gravity Forms MailChimp Add-On 4.3\n" -"Report-Msgid-Bugs-To: http://www.gravtiyhelp.com\n" -"POT-Creation-Date: 2018-04-10 16:38:34+00:00\n" +"Project-Id-Version: Gravity Forms MailChimp Add-On 4.4\n" +"Report-Msgid-Bugs-To: https://www.gravtiyforms.com\n" +"POT-Creation-Date: 2018-10-29 19:28:36+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -46,7 +46,7 @@ msgid "MailChimp Feed Settings" msgstr "" #: class-gf-mailchimp.php:335 class-gf-mailchimp.php:341 -#: class-gf-mailchimp.php:628 +#: class-gf-mailchimp.php:639 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:629 +#: class-gf-mailchimp.php:640 msgid "MailChimp List" msgstr "" @@ -103,70 +103,80 @@ msgstr "" msgid "Mark subscriber as VIP" msgstr "" -#: class-gf-mailchimp.php:409 +#: class-gf-mailchimp.php:409 class-gf-mailchimp.php:412 +msgid "Tags" +msgstr "" + +#: class-gf-mailchimp.php:413 +msgid "" +"Associate tags to your MailChimp contacts with a comma separated list. " +"(e.g. new lead, Gravity Forms, web source)" +msgstr "" + +#: class-gf-mailchimp.php:420 msgid "Note" msgstr "" -#: class-gf-mailchimp.php:413 class-gf-mailchimp.php:417 +#: class-gf-mailchimp.php:424 class-gf-mailchimp.php:428 msgid "Conditional Logic" msgstr "" -#: class-gf-mailchimp.php:418 +#: class-gf-mailchimp.php:429 msgid "" "When conditional logic is enabled, form submissions will only be exported " "to MailChimp when the conditions are met. When disabled all form " "submissions will be exported." msgstr "" -#: class-gf-mailchimp.php:481 class-gf-mailchimp.php:494 +#: class-gf-mailchimp.php:492 class-gf-mailchimp.php:505 msgid "Could not load MailChimp contact lists. %sError: %s" msgstr "" -#: class-gf-mailchimp.php:494 +#: class-gf-mailchimp.php:505 msgid "No lists found." msgstr "" -#: class-gf-mailchimp.php:506 +#: class-gf-mailchimp.php:517 msgid "Select a MailChimp List" msgstr "" -#: class-gf-mailchimp.php:552 +#: class-gf-mailchimp.php:563 msgid "Email Address" msgstr "" -#: class-gf-mailchimp.php:770 +#: class-gf-mailchimp.php:781 msgid "Assign to group:" msgstr "" -#: class-gf-mailchimp.php:779 +#: class-gf-mailchimp.php:790 msgid "Always" msgstr "" -#: class-gf-mailchimp.php:783 +#: class-gf-mailchimp.php:794 msgid "If" msgstr "" -#: class-gf-mailchimp.php:897 +#: class-gf-mailchimp.php:908 msgid "Abusing this may cause your MailChimp account to be suspended." msgstr "" -#: class-gf-mailchimp.php:928 +#: class-gf-mailchimp.php:939 msgid "Unable to process feed because API could not be initialized." msgstr "" -#: class-gf-mailchimp.php:943 +#: class-gf-mailchimp.php:954 msgid "A valid Email address must be provided." msgstr "" -#: class-gf-mailchimp.php:1057 +#: class-gf-mailchimp.php:1068 msgid "Unable to check if email address is already used by a member: %s" msgstr "" -#: class-gf-mailchimp.php:1251 +#: class-gf-mailchimp.php:1285 msgid "Unable to add/update subscriber: %s" msgstr "" -#: class-gf-mailchimp.php:1276 +#: class-gf-mailchimp.php:1310 msgid "Unable to add note to subscriber: %s" msgstr "" diff --git a/mailchimp.php b/mailchimp.php index 807729a..8265cea 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.3 +Version: 4.4 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.3' ); +define( 'GF_MAILCHIMP_VERSION', '4.4' ); // If Gravity Forms is loaded, bootstrap the Mailchimp Add-On. add_action( 'gform_loaded', array( 'GF_MailChimp_Bootstrap', 'load' ), 5 ); @@ -69,7 +69,7 @@ public static function load() { * * @see GFMailChimp::get_instance() * - * @return object GFMailChimp + * @return GFMailChimp */ function gf_mailchimp() { return GFMailChimp::get_instance();