Skip to content

Commit

Permalink
Merge branch 'release/4.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed Dec 12, 2018
2 parents 2dca369 + b4b427c commit 1e2cfb0
Show file tree
Hide file tree
Showing 30 changed files with 86 additions and 26 deletions.
6 changes: 5 additions & 1 deletion change_log.txt
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
34 changes: 34 additions & 0 deletions class-gf-mailchimp.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
'<h6>%s</h6>%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',
Expand Down Expand Up @@ -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';

Expand All @@ -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';

Expand Down
9 changes: 9 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "wp-premium/gravityformsmailchimp",
"type": "wordpress-plugin",
"autoload": {
"classmap": [
"."
]
}
}
3 changes: 3 additions & 0 deletions css/form_settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@
.gaddon-mailchimp-category .gf_animate_sub_settings {
padding-left: 10px;
}
.gaddon-mailchimp-category {
padding-bottom: 12px;
}
2 changes: 1 addition & 1 deletion css/form_settings.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added languages/gravityformsmailchimp-ar.mo
Binary file not shown.
Binary file modified languages/gravityformsmailchimp-ca.mo
Binary file not shown.
Binary file modified languages/gravityformsmailchimp-da_DK.mo
Binary file not shown.
Binary file modified languages/gravityformsmailchimp-de_DE.mo
Binary file not shown.
Binary file modified languages/gravityformsmailchimp-de_DE_formal.mo
Binary file not shown.
Binary file removed languages/gravityformsmailchimp-en.mo
Binary file not shown.
Binary file modified languages/gravityformsmailchimp-en_AU.mo
Binary file not shown.
Binary file modified languages/gravityformsmailchimp-en_GB.mo
Binary file not shown.
Binary file modified languages/gravityformsmailchimp-es_ES.mo
Binary file not shown.
Binary file modified languages/gravityformsmailchimp-fi.mo
Binary file not shown.
Binary file modified languages/gravityformsmailchimp-fr_CA.mo
Binary file not shown.
Binary file modified languages/gravityformsmailchimp-fr_FR.mo
Binary file not shown.
Binary file added languages/gravityformsmailchimp-hu_HU.mo
Binary file not shown.
Binary file modified languages/gravityformsmailchimp-it_IT.mo
Binary file not shown.
Binary file added languages/gravityformsmailchimp-ja.mo
Binary file not shown.
Binary file modified languages/gravityformsmailchimp-nb_NO.mo
Binary file not shown.
Binary file added languages/gravityformsmailchimp-nl_BE.mo
Binary file not shown.
Binary file modified languages/gravityformsmailchimp-nl_NL.mo
Binary file not shown.
Binary file modified languages/gravityformsmailchimp-pt_BR.mo
Binary file not shown.
Binary file modified languages/gravityformsmailchimp-pt_PT.mo
Binary file not shown.
Binary file modified languages/gravityformsmailchimp-ru_RU.mo
Binary file not shown.
Binary file added languages/gravityformsmailchimp-sv_SE.mo
Binary file not shown.
Binary file modified languages/gravityformsmailchimp-zh_CN.mo
Binary file not shown.
52 changes: 31 additions & 21 deletions languages/gravityformsmailchimp.pot
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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 ""

Expand All @@ -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 ""

Expand Down Expand Up @@ -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 ""

Expand Down
6 changes: 3 additions & 3 deletions mailchimp.php
Original file line number Diff line number Diff line change
Expand Up @@ -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+
Expand All @@ -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 );
Expand Down Expand Up @@ -69,7 +69,7 @@ public static function load() {
*
* @see GFMailChimp::get_instance()
*
* @return object GFMailChimp
* @return GFMailChimp
*/
function gf_mailchimp() {
return GFMailChimp::get_instance();
Expand Down

0 comments on commit 1e2cfb0

Please sign in to comment.