Home Forums Newsletter Plugin Support TNP::subscribe list parameter

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #126115
    Yeti
    Participant

    Hi,
    I try to pass data from Ninja to WP Hook, but the “list” parameter does not provide data. Only the Pre-assigned lists are added to the data.
    What can be wrong?

    TNP::subscribe([’email’=>$email, ‘name’=>$keresztnev, ‘list’=>’3’, ‘api_key’=>’70e692a358’]);

    Thanks for the help!

    Gabor

    #129960
    Anonymous
    Inactive

    Hi Gabor,

    Were you able to solve it ?

    Regards,
    Raj

    #129962
    Yeti
    Participant

    Yes, but since there was no answer, not by this method, but by html calling …

    $data = array( ‘nk’ => ‘API_key’, ‘ne’ => $email, ‘nn’=>$name, ‘nl’=>$list );
    $response = Requests::post( ‘https://xxxxx.xx/wp-content/plugins/newsletter-api/add.php’, array(), $data );

    #129974
    Anonymous
    Inactive

    I was checking the code looks like you need to use “Lists” not “list” in your code, as per tnp.php:
    // Lists (an arrayunder the key “lists”)
    // Preferences (field names are nl[] and values the list number so special forms with radio button can work)
    if (isset($params[‘lists’]) && is_array($params[‘lists’])) {
    foreach ($params[‘lists’] as $list_id) {
    $user[‘list_’ . ((int)$list_id)] = 1;
    }
    }

    Regards,
    Raj

    #130485
    Yeti
    Participant

    187/5000
    I’ve tried all sorts of variations, one thing, but it did not work.
    However, since the Ninja form module has been completed, I have put this problem down.
    Thanks for the idea!
    best regards
    Gabor

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.