Plugin Directory

Changeset 2128484


Ignore:
Timestamp:
07/25/2019 12:10:28 PM (7 years ago)
Author:
ehsantikweb
Message:

Fix mail not sent if subscriber exist, tagging 1.1.11

Location:
add-on-gravity-forms-mailpoet
Files:
4 edited
7 copied

Legend:

Unmodified
Added
Removed
  • add-on-gravity-forms-mailpoet/trunk/add-on-gravity-forms-mailpoet.php

    r2116901 r2128484  
    33 * Plugin Name:       Add-on Gravity Forms - Mailpoet 3
    44 * Description:       Add a MailPoet 3 signup field to your Gravity Forms.
    5  * Version:           1.1.11
     5 * Version:           1.1.12
    66 * Author:            Tikweb
    77 * Author URI:        http://www.tikweb.dk/
  • add-on-gravity-forms-mailpoet/trunk/changelog.txt

    r2116901 r2128484  
    11== Changelog ==
     2
     3= 1.1.12 - 2019-07-25 =
     4* Fix mail not sent if subscriber exist
    25
    36= 1.1.11 - 2019-07-03 =
  • add-on-gravity-forms-mailpoet/trunk/class-gfnewmailpoetaddon.php

    r2116901 r2128484  
    185185
    186186
    187         //If admin want to subscribe/unconfirme user with/without confirmation mail
     187        //If admin want to subscribe/unconfirm user with/without confirmation mail
    188188        if ($skipEmailValidation) {
    189189            $options['send_confirmation_email'] = false;
     
    205205
    206206            if ( 'This subscriber already exists.' == $exception->getMessage() ) {
    207 
    208207                try {
    209                     $subscriber = \MailPoet\API\API::MP( 'v1' )->subscribeToLists( $subscriber_data['email'], $mailpoetlists, $options );
     208                    if ($skipEmailValidation) {
     209                        $subscriber_data['status']          = 'subscribed';
     210                        Subscriber::createOrUpdate( $subscriber_data );
     211                    }
     212                    else {
     213                        $subscriber_data['status']          = 'unconfirmed';
     214                        Subscriber::createOrUpdate( $subscriber_data );
     215                        $subscriber = \MailPoet\API\API::MP( 'v1' )->subscribeToLists( $subscriber_data['email'], $mailpoetlists, $options['send_confirmation_email'] = true );
     216                    }
     217
    210218
    211219                } catch ( Exception $exception ) {
  • add-on-gravity-forms-mailpoet/trunk/readme.txt

    r2116901 r2128484  
    66Tested up to: 5.2.2
    77Requires PHP: 5.2
    8 Stable tag: 1.1.11
     8Stable tag: 1.1.12
    99
    1010Create MailPoet 3 newsletter subscribers from Gravity Form entries.
Note: See TracChangeset for help on using the changeset viewer.