Model/Sync/Automation.php
private function sendContactsToAutomation($contacts, $websiteId)
    {
        $client = $this->helper->getWebsiteApiClient($websiteId);
        $data = [
            'Contacts' => $contacts,
            'ProgramId' => $this->programId,
            'AddressBooks' => [],
        ];
        //api add contact to automation enrolment
        $result = $client->postProgramsEnrolments($data);

        return $result;
    }
private function sendContactsToAutomation($contacts, $websiteId)
    {
        $client = $this->helper->getWebsiteApiClient($websiteId);
        $data = [
            'Contacts' => $contacts,
            'ProgramId' => $this->programId,
            'AddressBooks' => [],
        ];
        //api add contact to automation enrolment
        $result = $client->postProgramsEnrolments($data);

        return $result;
    }
private function sendContactsToAutomation ( $ contacts , $ websiteId ) { $ client = $ this -> helper -> getWebsiteApiClient ( $ websiteId ) ; $ data = [ 'Contacts' => $ contacts , 'ProgramId' => $ this -> programId , 'AddressBooks' => [ ] , ] ; //api add contact to automation enrolment $ result = $ client -> postProgramsEnrolments ( $ data ) ; return $ result ; }
Enrol contacts for a program.

@param array $contacts
@param int $websiteId

@return mixed
@throws \Exception
Enrol contacts for a program .