Model/Apiconnector/Client.php
public function updateContactDatafieldsByEmail($email, $dataFields)
    {
        $apiContact = $this->postContacts($email);
        //do not create for non contact id set
        if (!isset($apiContact->id)) {
            return $apiContact;
        } else {
            //get the contact id for this email
            $contactId = $apiContact->id;
        }
        $data = [
            'Email' => $email,
            'EmailType' => 'Html',
        ];
        $data['DataFields'] = $dataFields;
        $url = $this->getApiEndpoint() . self::REST_CONTACTS
            . $contactId;
        $this->setUrl($url)
            ->setVerb('PUT')
            ->buildPostBody($data);

        $response = $this->execute();
        if (isset($response->message)) {
            $message = 'ERROR: UPDATE CONTACT DATAFIELD ' . $url . ' message : '
                . $response->message;
            $this->helper->debug('updateContactDatafieldsByEmail', [$message]);
            $this->helper->debug('updateContactDatafieldsByEmail', $data);
        }

        return $response;
    }
public function updateContactDatafieldsByEmail($email, $dataFields)
    {
        $apiContact = $this->postContacts($email);
        //do not create for non contact id set
        if (!isset($apiContact->id)) {
            return $apiContact;
        } else {
            //get the contact id for this email
            $contactId = $apiContact->id;
        }
        $data = [
            'Email' => $email,
            'EmailType' => 'Html',
        ];
        $data['DataFields'] = $dataFields;
        $url = $this->getApiEndpoint() . self::REST_CONTACTS
            . $contactId;
        $this->setUrl($url)
            ->setVerb('PUT')
            ->buildPostBody($data);

        $response = $this->execute();
        if (isset($response->message)) {
            $message = 'ERROR: UPDATE CONTACT DATAFIELD ' . $url . ' message : '
                . $response->message;
            $this->helper->debug('updateContactDatafieldsByEmail', [$message]);
            $this->helper->debug('updateContactDatafieldsByEmail', $data);
        }

        return $response;
    }
public function updateContactDatafieldsByEmail ( $ email , $ dataFields ) { $ apiContact = $ this -> postContacts ( $ email ) ; //do not create for non contact id set if ( ! isset ( $ apiContact -> id ) ) { return $ apiContact ; } else { //get the contact id for this email $ contactId = $ apiContact -> id ; } $ data = [ 'Email' => $ email , 'EmailType' => 'Html' , ] ; $ data [ 'DataFields' ] = $ dataFields ; $ url = $ this -> getApiEndpoint ( ) . self :: REST_CONTACTS . $ contactId ; $ this -> setUrl ( $ url ) -> setVerb ( 'PUT' ) -> buildPostBody ( $ data ) ; $ response = $ this -> execute ( ) ; if ( isset ( $ response -> message ) ) { $ message = 'ERROR: UPDATE CONTACT DATAFIELD ' . $ url . ' message : ' . $ response -> message ; $ this -> helper -> debug ( 'updateContactDatafieldsByEmail' , [ $ message ] ) ; $ this -> helper -> debug ( 'updateContactDatafieldsByEmail' , $ data ) ; } return $ response ; }
Update contact datafields by email.

@param string $email
@param array $dataFields

@return mixed|null

@throws \Exception
Update contact datafields by email .