0

I'm trying to automatically add a contact to a Constant Contact list when a form is submitted and have started with the addOrUpdateContact sample code that uses Constant Contact v2 API. I'm getting the following error when I submit the form:

Catchable fatal error: Argument 3 passed to Ctct\Services\ContactService::addContact() must be of the type array, boolean given, called in /home/cspacetribeca/public_html/mh/test.php on line 65 and defined in /home/cspacetribeca/public_html/mh/vendor/constantcontact/constantcontact/src/Ctct/Services/ContactService.php on line 131

The line referenced is:

$returnContact = $cc->contactService->addContact(ACCESS_TOKEN, $contact, true);

And ContactService.php, on line 131, does ask for an array:

public function addContact($accessToken, Contact $contact, Array $params = array())

How do I fix this?

Thanks - Joe

4

1 回答 1

0

获取ConstantContact SDK的更新版本(我与该项目无关)。您可以从此差异中看到,它已于 2015 年 12 月更新,其中包含修改后的addContact()函数定义。因此,您可能引用了更新的“官方示例代码”,但仍在使用旧的 SDK。

定义从

public function addContact($accessToken, Contact $contact, Array $params = array()) {

public function addContact($accessToken, Contact $contact, $actionByContact) {
于 2016-02-12T16:58:27.217 回答