Home Forums Newsletter Developers Functions for Groups

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #262300
    ssimo3@lsuhsc.edu
    Participant

    Hello!
    I’m posting in this forum because I’m trying to develop my own plugin for WordPress that integrates with both the Newsletter Plugin and Pods (a popular plugin for custom content types). I’ve looked over the code for the NewsletterModules class and its derived NewsletterUsers class, but I’m expecting a NewsletterLists class and do not see one. I would like to know where the functions that retrieve and manage subscriber lists are located. Clarification: I need a function that retrieves the names of ALL the lists, not just the lists of a single subscriber. Thank you!!!

    Stuart Simon

    #262301
    ssimo3@lsuhsc.edu
    Participant

    I found the function NewsletterModule::get_lists(), but I would like to know which function (if any) adds a given TNP_User to a TNP_List.

    Also, I will be managing the relationship between the Newsletter Plugin and Pods with a custom field named pods_id. It would be helpful to know if I can run code such as the following:

    `
    $newsletterUsers = NewsletterUsers::instance();
    $tnpUser = null;
    if ($newsletterUsers->email_exists($email)) {
    $tnpUser = $users->get_user($email);
    $newsletterUsers->set_user_field($user->id, “name”, $name);
    $newsletterUsers->set_user_field($user->id, “pods_id”, $pods_id);
    } else {
    $tnpUser = $users->save_user(array(
    “email” => $email,
    “name” => $name,
    “pods_id” => $pods_id
    );
    }
    `

    Note that in my array, I did NOT nest the custom fields within their own property.

    Thank you!!!

    Stuart

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