'required|email:rfc,dns,spoof,filter', 'opt_in' => 'required|bool', ]; /** * Set the single optin status for an email * * @param string $email * @param boolean $opt_in * @return boolean true if succeeded * @throws ApiErrorException ApiError::singleOptinCustomerExists If single optin already exists * @throws \LDC\LDCCRM\Exceptions\CrmException * if an error occurs on server side or on getting response * @throws \LDC\LDCCRM\Exceptions\ApiErrorException * If any error or \LDC\LDCCRM\Enums\ApiError occurs */ public static function setStatus(string $email, bool $opt_in): bool { self::validateValue('email', $email); static::setUpApiInterface(); // set apiInterface $request = Utils::getResquest('apiV2.optin', [], [ 'email' => $email, 'opt_in' => $opt_in ]); $response = static::$apiInterface->call($request); return $response->status->equals(ApiStatus::OK()); } }