how do I get an array of the current lists a contact is signed up for? tried:
$lists = $contact->getLists();
which just gave me an empty array...
Also, please, where are the docs for this wrapper?
Solved! Go to Solution.
Hi,
You do not need to get the contact ID before listing the contact details. The listContactDetails function requires the contact object. Instead of getting the id, you would just do this:
This snippet will give you a printed array of lists for the emailaddress@test.com. If you have any questions please let me know.
Regards,
Hello,
You can get the lists by pulling the contacts details. In the phpwrapper you would do a call to the listContactDetails function. This will list all of the contacts details, which include a field that gives you an array of all the lists the contact is currently on. You can then call the getLists function on the contact object, and it should return all the lists.
If you have any questions, or are still running into an issue, please let me know.
Regards,
<?php require_once("ctctWrapper.php");?> <?php updateContact($myrecordset); ?> <?php function updateContact($newmember){ //get the the user id using search by email $contacts = new ContactsCollection(); $search = $contacts->searchByEmail($newmember['UserEmail']); //print_r($search); works great if($search){ // if $search then get contact id $contactId = $search[0][0]->getId(); //this is where I lose it I think $bobbuttons=$contacts->listContactDetails($contactId); print_r($bobbuttons); }
Sorry, I'm not getting some basic concepts still...
Hi,
You do not need to get the contact ID before listing the contact details. The listContactDetails function requires the contact object. Instead of getting the id, you would just do this:
This snippet will give you a printed array of lists for the emailaddress@test.com. If you have any questions please let me know.
Regards,
thank you, good sir...that solved it.
Once again...are there any sample files or docs for this wrapper? Without the docs, it is almost easier to use the long methods...almost.
The holidays have come and gone. For many seasonal businesses, this means the rush of shoppers has decreased as well. Instead of turning off the lights and waiting for spring, make your email marketi...
See Article