public function Add($publicAccountID, $email, array $publicListID = array(), array $listName = array(), $firstName = null, $lastName = null, $source = \ElasticEmailEnums\ContactSource::ContactApi, $returnUrl = null, $sourceUrl = null, $activationReturnUrl = null, $activationTemplate = null, $sendActivation = true, $consentDate = null, $consentIP = null, array $field = array(), $notifyEmail = null, $alreadyActiveUrl = null, $consentTracking = \ElasticEmailEnums\ConsentTracking::Unknown) {
        $arr = array('publicAccountID' => $publicAccountID,
                    'email' => $email,
                    'publicListID' => (count($publicListID) === 0) ? null : join(';', $publicListID),
                    'listName' => (count($listName) === 0) ? null : join(';', $listName),
                    'firstName' => $firstName,
                    'lastName' => $lastName,
                    'source' => $source,
                    'returnUrl' => $returnUrl,
                    'sourceUrl' => $sourceUrl,
                    'activationReturnUrl' => $activationReturnUrl,
                    'activationTemplate' => $activationTemplate,
                    'sendActivation' => $sendActivation,
                    'consentDate' => $consentDate,
                    'consentIP' => $consentIP,
                    'notifyEmail' => $notifyEmail,
                    'alreadyActiveUrl' => $alreadyActiveUrl,
                    'consentTracking' => $consentTracking        );
        foreach(array_keys($field) as $key) {
            $arr['field_'.$key] = $field[$key]; 
        }
        return $this->sendRequest('contact/add', $arr);
    }
public function Add($publicAccountID, $email, array $publicListID = array(), array $listName = array(), $firstName = null, $lastName = null, $source = \ElasticEmailEnums\ContactSource::ContactApi, $returnUrl = null, $sourceUrl = null, $activationReturnUrl = null, $activationTemplate = null, $sendActivation = true, $consentDate = null, $consentIP = null, array $field = array(), $notifyEmail = null, $alreadyActiveUrl = null, $consentTracking = \ElasticEmailEnums\ConsentTracking::Unknown) {
        $arr = array('publicAccountID' => $publicAccountID,
                    'email' => $email,
                    'publicListID' => (count($publicListID) === 0) ? null : join(';', $publicListID),
                    'listName' => (count($listName) === 0) ? null : join(';', $listName),
                    'firstName' => $firstName,
                    'lastName' => $lastName,
                    'source' => $source,
                    'returnUrl' => $returnUrl,
                    'sourceUrl' => $sourceUrl,
                    'activationReturnUrl' => $activationReturnUrl,
                    'activationTemplate' => $activationTemplate,
                    'sendActivation' => $sendActivation,
                    'consentDate' => $consentDate,
                    'consentIP' => $consentIP,
                    'notifyEmail' => $notifyEmail,
                    'alreadyActiveUrl' => $alreadyActiveUrl,
                    'consentTracking' => $consentTracking        );
        foreach(array_keys($field) as $key) {
            $arr['field_'.$key] = $field[$key]; 
        }
        return $this->sendRequest('contact/add', $arr);
    }
public function Add ( $ publicAccountID , $ email , array $ publicListID = array ( ) , array $ listName = array ( ) , $ firstName = null , $ lastName = null , $ source = \ ElasticEmailEnums \ ContactSource :: ContactApi , $ returnUrl = null , $ sourceUrl = null , $ activationReturnUrl = null , $ activationTemplate = null , $ sendActivation = true , $ consentDate = null , $ consentIP = null , array $ field = array ( ) , $ notifyEmail = null , $ alreadyActiveUrl = null , $ consentTracking = \ ElasticEmailEnums \ ConsentTracking :: Unknown ) { $ arr = array ( 'publicAccountID' => $ publicAccountID , 'email' => $ email , 'publicListID' => ( count ( $ publicListID ) === 0 ) ? null : join ( ';' , $ publicListID ) , 'listName' => ( count ( $ listName ) === 0 ) ? null : join ( ';' , $ listName ) , 'firstName' => $ firstName , 'lastName' => $ lastName , 'source' => $ source , 'returnUrl' => $ returnUrl , 'sourceUrl' => $ sourceUrl , 'activationReturnUrl' => $ activationReturnUrl , 'activationTemplate' => $ activationTemplate , 'sendActivation' => $ sendActivation , 'consentDate' => $ consentDate , 'consentIP' => $ consentIP , 'notifyEmail' => $ notifyEmail , 'alreadyActiveUrl' => $ alreadyActiveUrl , 'consentTracking' => $ consentTracking ) ; foreach ( array_keys ( $ field ) as $ key ) { $ arr [ 'field_' . $ key ] = $ field [ $ key ] ; } return $ this -> sendRequest ( 'contact/add' , $ arr ) ; }
Add a new contact and optionally to one of your lists.  Note that your API KEY is not required for this call.
@param string $publicAccountID Public key for limited access to your account such as contact/add so you can use it safely on public websites.
@param string $email Proper email address.
@param array<string> $publicListID ID code of list
@param array<string> $listName Name of your list.
@param string $firstName First name.
@param string $lastName Last name.
@param \ElasticEmailEnums\ContactSource $source Specifies the way of uploading the contact
@param string $returnUrl URL to navigate to after account creation
@param string $sourceUrl URL from which request was sent.
@param string $activationReturnUrl The url to return the contact to after activation.
@param string $activationTemplate
@param bool $sendActivation True, if you want to send activation email to this account. Otherwise, false
@param ?DateTime $consentDate Date of consent to send this contact(s) your email. If not provided current date is used for consent.
@param string $consentIP IP address of consent to send this contact(s) your email. If not provided your current public IP address is used for consent.
@param array<string, string> $field Custom contact field like firstname, lastname, city etc. Request parameters prefixed by field_ like field_firstname, field_lastname
@param string $notifyEmail Emails, separated by semicolon, to which the notification about contact subscribing should be sent to
@param string $alreadyActiveUrl
@param \ElasticEmailEnums\ConsentTracking $consentTracking
@return string
Add a new contact and optionally to one of your lists . Note that your API KEY is not required for this call .