Plugin Directory

Changeset 2822860


Ignore:
Timestamp:
11/23/2022 12:28:11 PM (3 years ago)
Author:
mailup
Message:

v 1.2.1 fix an issue with confirmation request emails

Location:
mailup-email-and-newsletter-subscription-form
Files:
199 added
4 edited

Legend:

Unmodified
Added
Removed
  • mailup-email-and-newsletter-subscription-form/trunk/README.txt

    r2820371 r2822860  
    55Tested up to: 6.1.1
    66Requires PHP: 7.2
    7 Stable tag: 1.2.0
     7Stable tag: 1.2.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    177177* [ENG] _We fixed an issue with privacy groups. When they had more than 50 characters they were not created correctly. To ensure in the future the ability to create groups with many characters (max 45), we have renamed the privacy groups in "TC" no longer Terms and Conditions._
    178178
     179= 1.2.1 =
     180* [ITA] Risolto un problema per cui uno stesso iscritto poteva ricevere più email di richiesta conferma iscrizione. Questa casistica si verificava quando il plugin era configurato per iscriversi su uno o più gruppi MailUp.
     181* [ENG] _We fixed an issue with confirmation request emails. In some cases, subscibers received more than one confirmation request email after submitting their data. This happened when the plugin was configured with one or more target groups on MailUp._
     182
    179183== Screenshots ==
    180184
  • mailup-email-and-newsletter-subscription-form/trunk/includes/class-mailup-configuration.php

    r2646650 r2822860  
    1212    /**PUBLIC SERVICE URL */
    1313    const URL_ADD_RECIPIENT = 'API/v1.1/Rest/ConsoleService.svc/Console/List/%s/Recipient';
    14     const URL_ADD_TO_GROUP = 'API/v1.1/Rest/ConsoleService.svc/Console/Group/%s/Recipient';
     14    const URL_ADD_TO_GROUP = 'API/v1.1/Rest/ConsoleService.svc/Console/Group/%s/Subscribe/%s';
    1515
    1616    /**COMMON SERVICE URL */
  • mailup-email-and-newsletter-subscription-form/trunk/includes/class-mailup-model.php

    r2646650 r2822860  
    268268            ];
    269269
    270             $this->api->addRecipient((object)$args);
     270            $recipient_id = $this->api->addRecipient((object)$args);
    271271
    272272            foreach ($groups as $group_id) {
    273273                $args['group_id'] = $group_id;
     274                $args['recipient_id'] = $recipient_id;
    274275                $this->api->addToGroup((object)$args);
    275276            }
  • mailup-email-and-newsletter-subscription-form/trunk/includes/class-mailup-requests.php

    r2646650 r2822860  
    260260            throw new \Exception('', $code);
    261261        }
     262
     263        return $body;
    262264    }
    263265
     
    269271            'body'  => $args->body
    270272        ];
    271        
    272         $this->set_headers(self::HEADER_JSON, $this->get_header_authorization());
    273        
    274         $url_service = $this->build_service_request('add_to_group', [$args->group_id]);
     273        $params = [
     274            'confirmSubscription' => 'false'
     275        ];
     276       
     277        $this->set_headers(self::HEADER_JSON, $this->get_header_authorization());
     278       
     279        $url_service = $this->build_service_request('add_to_group', [$args->group_id, $args->recipient_id], $params);
    275280
    276281        $resp = $this->make_request($url_service, $this->tokens, 'POST');
     
    281286        if (is_wp_error($resp) || 200 > $code || 300 <= $code) {
    282287            $error = json_decode($body);
     288            error_log($body);
    283289            error_log(print_R($error, true));
    284290            throw new \Exception('', $code);
Note: See TracChangeset for help on using the changeset viewer.