action = null; if ($this->createMailchimpList($list_name)) { $this->confirmations[] = $this->l('List created successfully'); } else { $this->errors[] = $this->l("Oups! Failed to create list: {$this->mailchimp->getLastError()}"); } } } /** * @param $list_name * * @return array|false * @throws Exception */ private function createMailchimpList($list_name) { return \PrestaChamps\MailchimpPro\Factories\ListFactory::make( $list_name, $this->module->getApiClient(), $this->context ); } protected function getListApiEndpointUrl() { return '/lists'; } protected function getSingleApiEndpointUrl($entityId) { return "lists/{$entityId}"; } }