I am updating some contact info using phpWrapper, but I don't want to update the info for contacts that are "removed", yet I can't find a way to distinguish between active contacts and removed contacts in listContactDetails().
Hey Erin,
I looked into your issue and actually revised the wrapper a little bit in order to get this to work the way I believe you need it to.
Please open the ctctWrapper.php file and goto line 1234 and modify it so it looks like this:
$utility = new Utility(); if ($params['status'] == 'Do Not Mail') { $utility->setActionBy('ACTION_BY_CONTACT'); $this->setStatus($params['status']); } else { $this->setStatus($params['status']); }
This will allow you to now use the getStatus method located under the contact class. Here is an example of how this would work
<?php include_once('ctctwrapper.php'); // Istantiate Utility $ConstantContact = new Utility(); // Istantiate Contacts as part of the Contacts Collection $Contacts = new ContactsCollection(); // Get all the contacts and put into the $Contact Variable $Contact = $Contacts->listContacts(); // This will put the specific object data into the $OneContact Variable $OneContact = $Contacts->listContactDetails($Contact[0][0]); // myContact will now hold the status of the Object data of $OneContact $myContact = $OneContact->getStatus(); // output data print_r($myContact); ?>
Please let me know if this helps,
thank you...can you explain why you put this in the if and the else statement?
I just did this:
$utility = new Utility(); if ($params['status'] == 'Do Not Mail') { $utility->setActionBy('ACTION_BY_CONTACT'); } $this->setStatus($params['status']);
since I am doing the same thing no matter what, whay am I creating an else? It seems to work fine the way I did it, but I am happy to change it.
Hey Erin,
That will work fine, I put it in the statement as I was testing something out with it and that appears to work with out creating any errors in the wrapper.
Let me know if you need any more help.
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