Plugin Directory

Changeset 2466186


Ignore:
Timestamp:
02/01/2021 07:14:38 AM (5 years ago)
Author:
Kasperta
Message:

adding 1.3.16

Location:
add-on-contact-form-7-mailpoet/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • add-on-contact-form-7-mailpoet/trunk/add-on-contact-form-7-mailpoet.php

    r2455527 r2466186  
    33 * Plugin Name:       Add-on Contact Form 7 - Mailpoet 3
    44 * Description:       Add a MailPoet 3 signup field to your Contact Form 7 forms.
    5  * Version:           1.3.15
     5 * Version:           1.3.16
    66 * Author:            Tikweb
    77 * Author URI:        http://www.tikweb.dk/
  • add-on-contact-form-7-mailpoet/trunk/changelog.txt

    r2455527 r2466186  
    11== Changelog ==
     2= 1.3.16 - 2021-01-29 =
     3* Using mailpoetsignup & mpconsent at a time related issues fixed.
     4
    25= 1.3.15 - 2021-01-07 =
    36* Fixed error created by a debug file.
  • add-on-contact-form-7-mailpoet/trunk/includes/class-mailpoet-cf7-integration.php

    r2455527 r2466186  
    120120
    121121            if ( ! $tag->has_option( 'subscriber-choice' ) ) {
    122                 $atts['value'] = ( $list_array ) ? implode( ',', $list_array ) : '0';
     122                $atts['value'] = ( $list_array ) ? implode(',', $list_array) : '0';
    123123            }
    124124
  • add-on-contact-form-7-mailpoet/trunk/includes/class-mailpoet-cf7-submit-form.php

    r2455527 r2466186  
    8585            //Check this form has mailpoet tag and email field is not empty and also checking the tag name
    8686            $has_mailpoet_tag = false;
     87            $has_mailpoetsignup_tag = false;
     88            $has_mpconsent_tag = false;
    8789            $mailpoet_tag_name = '';
    8890            if ( isset( $field_names['mailpoetsignup'] ) && ! empty( $field_names['mailpoetsignup'] ) && is_array( $field_names['mailpoetsignup'] ) ) {
    8991                $has_mailpoet_tag = true;
     92                $has_mailpoetsignup_tag = true;
    9093                $mailpoet_tag_name='mailpoetsignup';
     94
    9195            }
    9296
    9397            if ( isset( $field_names['mpconsent'] ) && ! empty( $field_names['mpconsent'] ) && is_array( $field_names['mpconsent'] ) ) {
    9498                $has_mailpoet_tag = true;
     99                $has_mpconsent_tag = true;
    95100                $mailpoet_tag_name='mpconsent';
    96101            }
     
    137142                }
    138143
     144
     145
    139146                //Save all list
    140147                $list_ids = array();
    141148
    142149                //Checking the tag name
    143                 if ($mailpoet_tag_name == 'mailpoetsignup') {
     150                if ($mailpoet_tag_name == 'mailpoetsignup' || $has_mailpoetsignup_tag) {
    144151                    //Get all the form tags
    145152                    foreach ( $form_tags as $FormTag ) {
     
    161168                                                }
    162169                                            }
    163 
    164170                                            //Get the new list ids from hidden form
    165171                                            $new_list_ids = $form_data['fieldVal'];
     
    168174
    169175                                            $list_ids = array_merge( $list_ids, $current_list );
     176
    170177                                        }
    171178                                    }
     
    175182                    }
    176183                }
    177                 elseif ($mailpoet_tag_name == 'mpconsent') {
     184                elseif ($mailpoet_tag_name == 'mpconsent' || $has_mpconsent_tag) {
    178185                    //collecting the lists
    179186                    $lists = \MailPoet\API\API::MP('v1')->getLists();
     
    212219                        'status'     => $signup_confirm_state,
    213220                    );
     221
    214222
    215223                    #If custom field presents, append the fields value to subscribe data
     
    237245                    //Saving new subscriber
    238246                    try {
    239                         $subscriber = \MailPoet\API\API::MP( 'v1' )->addSubscriber( $subscribe_data,
    240                             array_unique( $list_ids ), $options );
     247                        $subscriber = \MailPoet\API\API::MP( 'v1' )->addSubscriber( $subscribe_data, array_unique( $list_ids ), $options );
    241248                    } catch ( Exception $exception ) {
    242249
     
    250257                            try {
    251258                                //If 'mpconsent' form active it will add all lists.
    252                                 if ($mailpoet_tag_name == 'mpconsent') {
     259                                if ($has_mpconsent_tag && !$has_mailpoetsignup_tag) {
    253260                                    $current_list = $list_ids ;
    254261                                }
     
    263270                        }
    264271                    }
    265 
    266 
    267272                }
    268273
  • add-on-contact-form-7-mailpoet/trunk/readme.txt

    r2455527 r2466186  
    66Tested up to: 5.5.1
    77Requires PHP: 7.0
    8 Stable tag: 1.3.15
     8Stable tag: 1.3.16
    99
    1010Add a MailPoet 3 signup field to your Contact Form 7 forms.
Note: See TracChangeset for help on using the changeset viewer.