• Resolved ookris

    (@ookris)


    I followed the description at https://kb.mailpoet.com/article/195-add-subscribers-through-your-own-form-or-plugin but unfortunately adding subscribers does not work.
    My code looks like this

    
    <?php 
    
    subscriber_data = array(
       'email' => $_GET['email'],
       'first_name' => $_GET['first_name'],
       'last_name' => $_GET['last_name']
    );
     
    $lists = 3;
    
    try {
       $subscriber = \MailPoet\API\API::MP('v1')->addSubscriber($subscriber_data, $lists, $options);
    } catch(Exception $exception) {
       // return $exception->getMessage();
    }
    
    echo print_r($subscriber_data, TRUE);
     
    ?>
    

    The script is called like this

    https://bolecair.info/wp-content/uploads/mailpoet/add_sub.php?email=xxx@yyy.zz&first_name=Name&last_name=LName

    What is wrong?

    • This topic was modified 6 months, 1 week ago by ookris.
    • This topic was modified 6 months, 1 week ago by ookris.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.