findSubscriber always returns 0

Use this forum for questions regarding adoption and functionality of OpenEMM

Moderator: moderator

dpommeranz
Posts: 2
Joined: Tue Aug 12, 2008 11:58 am

findSubscriber always returns 0

Post by dpommeranz »

Hi Guys,

I am very impressed by the functionality of OpenEMM. But I have some problems withe the webservice functionality.

I created custom profile fields like the field "sec_import".
Now I want to delete all subscriber who have the value "xyz" in the field "sec_import" with the following php-code:

Code: Select all

do {
  $subscriberID = $service->findSubscriber('sec_import', 'xyz');
  $service->deleteSubscriber($subscriberID);
} while ($subscriberID > 0);
With a search on the email-address (but only without placeholders) the findSubscriber method returns the right ID. Why does the search on a custom field give me a wrong result?

Best Regards
dpommeranz
maschoff
Site Admin
Posts: 2608
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany
Contact:

Post by maschoff »

findSubscriber can not deliver an array of IDs but only a single value, so the value of the search column has to be unique. If more than one recipient holds the same value in the search column the method does not work.
OpenEMM Maintainer
fnagel
Posts: 4
Joined: Tue Jan 12, 2010 5:35 pm
Location: Münster, Germany
Contact:

Post by fnagel »

I think there is a mistake in the webservice documentation in the method-definition of the findSubscriber method:
"return 0 or customerID of the first match."

As you posted, the method doesn't work if more than one recipient holds the same value?

But is there any other way to get more then one subscriber, e.g. by gender or some other keyColumns with the webservice?
stay posi!
Post Reply