Changeset 2321619
- Timestamp:
- 06/10/2020 01:40:33 PM (6 years ago)
- Location:
- add-on-gravity-forms-mailpoet
- Files:
-
- 4 edited
- 1 copied
-
tags/1.1.12 (copied) (copied from add-on-gravity-forms-mailpoet/trunk)
-
trunk/add-on-gravity-forms-mailpoet.php (modified) (4 diffs)
-
trunk/changelog.txt (modified) (2 diffs)
-
trunk/class-gfnewmailpoetaddon.php (modified) (1 diff)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
add-on-gravity-forms-mailpoet/trunk/add-on-gravity-forms-mailpoet.php
r2128484 r2321619 3 3 * Plugin Name: Add-on Gravity Forms - Mailpoet 3 4 4 * Description: Add a MailPoet 3 signup field to your Gravity Forms. 5 * Version: 1.1.1 25 * Version: 1.1.13 6 6 * Author: Tikweb 7 7 * Author URI: http://www.tikweb.dk/ … … 398 398 $mailpoetlists = array_unique(array_merge( $mailpoetlists, $list_ids )); 399 399 } 400 400 401 401 /* Fix added end. Version 1.1.6 */ 402 402 … … 452 452 } catch ( Exception $exception ) { 453 453 454 if ( 'This subscriber already exists.' == $exception->getMessage() ) { 454 455 //== Below code is modifed in version 1.1.13 by k4mrul ==\\ 456 457 //If subscriber already exist 458 if ( 12 == $exception->getCode() ) { 455 459 try { 456 $subscriber_data['status'] = 'unconfirmed'; 457 Subscriber::createOrUpdate( $subscriber_data ); 458 $subscriber = \MailPoet\API\API::MP( 'v1' )->subscribeToLists( $subscriber_data['email'], $mailpoetlists, $options['send_confirmation_email'] = true ); 460 //If subscriber already exist, simply add subscriber to the new list. Subscriber status will be subscribed as s/he already confirmed email. s/he may get a new mail from mailpoet for confirmation but s/he already considered as subscribed 461 $existingUser = \MailPoet\API\API::MP( 'v1' )->getSubscriber($subscriber_data['email']); 462 463 \MailPoet\API\API::MP( 'v1' )->subscribeToLists($existingUser['subscriptions'][0]['subscriber_id'], $mailpoetlists , $options['send_confirmation_email'] = true); 464 465 //Previous code. Previously we make the subscriber status unconfirmed and let him/her to confirm the email for new list. But that's not how mailpoet's default behavior works. So we respected default behavior 466 //$subscriber_data['status'] = 'unconfirmed'; 467 //Subscriber::createOrUpdate( $subscriber_data ); 468 //$subscriber = \MailPoet\API\API::MP( 'v1' )->subscribeToLists( $subscriber_data['email'], $mailpoetlists, $options['send_confirmation_email'] = true ); 459 469 460 470 } catch ( Exception $exception ) { … … 469 479 470 480 //Deprecated: 471 /* $subscriber_data['segments'] = $mailpoetlists;472 473 474 $subscriber = Subscriber::createOrUpdate( $subscriber_data );475 $sagments = $subscriber->segments()->findMany();476 $notification_sender = new NewSubscriberNotificationMailer();477 478 if ( ! empty( $subscriber ) ) {479 480 $subscriber_status = Subscriber::whereEqual( 'email',481 $email )->whereEqual( 'status', 'subscribed' )->findArray();482 483 //If the subscriber is new, send email confirmation to subscribe for the list. Otherwise, if subscriber already confirm the email for another list and subscribe to the new list, don't send confirmation email again.484 if ( empty( $subscriber_status[0]['confirmed_ip'] ) ) {485 $confirmation_sender = new ConfirmationEmailMailer();486 $confirmation_sender->sendConfirmationEmail( $subscriber );487 } //Notify the admin that existed subscriber subscribed to the new list488 else {489 $notification_sender->send( $subscriber, $sagments );490 }491 }*/492 } 493 } 481 /* $subscriber_data['segments'] = $mailpoetlists; 482 483 484 $subscriber = Subscriber::createOrUpdate( $subscriber_data ); 485 $sagments = $subscriber->segments()->findMany(); 486 $notification_sender = new NewSubscriberNotificationMailer(); 487 488 if ( ! empty( $subscriber ) ) { 489 490 $subscriber_status = Subscriber::whereEqual( 'email', 491 $email )->whereEqual( 'status', 'subscribed' )->findArray(); 492 493 //If the subscriber is new, send email confirmation to subscribe for the list. Otherwise, if subscriber already confirm the email for another list and subscribe to the new list, don't send confirmation email again. 494 if ( empty( $subscriber_status[0]['confirmed_ip'] ) ) { 495 $confirmation_sender = new ConfirmationEmailMailer(); 496 $confirmation_sender->sendConfirmationEmail( $subscriber ); 497 } //Notify the admin that existed subscriber subscribed to the new list 498 else { 499 $notification_sender->send( $subscriber, $sagments ); 500 } 501 }*/ 502 } 503 } -
add-on-gravity-forms-mailpoet/trunk/changelog.txt
r2128484 r2321619 1 1 == Changelog == 2 3 = 1.1.13 - 2020-06-08 = 4 * Fix mail not sent issue if subscriber exist and the language is not english 2 5 3 6 = 1.1.12 - 2019-07-25 = … … 66 69 = x.0.0 = 67 70 * There are nothing else needed, than upgrading from the WordPress plugins screen. 71 -
add-on-gravity-forms-mailpoet/trunk/class-gfnewmailpoetaddon.php
r2128484 r2321619 204 204 } catch ( Exception $exception ) { 205 205 206 if ( 'This subscriber already exists.' == $exception->getMessage() ) { 206 //If subscriber already exist 207 if ( 12 == $exception->getCode() ) { 207 208 try { 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 } 209 210 //== Below code is modifed in version 1.1.13 by k4mrul ==\\ 211 212 //If subscriber already exist, simply add subscriber to the new list. Subscriber status will be subscribed as s/he already confirmed email. s/he may get a new mail from mailpoet for confirmation but s/he already counted as subscribed 213 $existingUser = \MailPoet\API\API::MP( 'v1' )->getSubscriber($subscriber_data['email']); 214 215 \MailPoet\API\API::MP( 'v1' )->subscribeToLists($existingUser['subscriptions'][0]['subscriber_id'], $mailpoetlists , $options); 216 217 //Previous code. Previously we make the subscriber status unconfirmed and let him/her to confirm the email for new list. But that's not how mailpoet's default behavior works. 218 219 // if ($skipEmailValidation) { 220 // $subscriber_data['status'] = 'subscribed'; 221 // Subscriber::createOrUpdate( $subscriber_data ); 222 // } 223 // else { 224 // $subscriber_data['status'] = 'unconfirmed'; 225 // Subscriber::createOrUpdate( $subscriber_data ); 226 // $subscriber = \MailPoet\API\API::MP( 'v1' )->subscribeToLists( $subscriber_data['email'], $mailpoetlists, $options['send_confirmation_email'] = true ); 227 // } 217 228 218 229 -
add-on-gravity-forms-mailpoet/trunk/readme.txt
r2128484 r2321619 4 4 Tags: mailpoet, gravity forms, gravityforms, form, forms, contact form, wysija, woocommerce, e-commerce, mail, email, e-mail, extension, add-on, newsletter, newsletters, subscription, checkout, list, lists, double opt-in 5 5 Requires at least: 4.6 6 Tested up to: 5. 2.26 Tested up to: 5.3.2 7 7 Requires PHP: 5.2 8 Stable tag: 1.1.1 28 Stable tag: 1.1.13 9 9 10 10 Create MailPoet 3 newsletter subscribers from Gravity Form entries.
Note: See TracChangeset
for help on using the changeset viewer.