public function notify($string)
    {
        if (filter_var($string, FILTER_VALIDATE_EMAIL)) {
            $this->otherOptions['notifyEmail'] = $string;

            return $this;
        }
        if (filter_var($string, FILTER_VALIDATE_URL)) {
            $this->otherOptions['notifyWebhook'] = urlencode($string);

            return $this;
        }

        throw new InvalidArgumentException(
            'Only valid email or URL accepted! You provided: ' . $string
        );
    }
public function notify($string)
    {
        if (filter_var($string, FILTER_VALIDATE_EMAIL)) {
            $this->otherOptions['notifyEmail'] = $string;

            return $this;
        }
        if (filter_var($string, FILTER_VALIDATE_URL)) {
            $this->otherOptions['notifyWebhook'] = urlencode($string);

            return $this;
        }

        throw new InvalidArgumentException(
            'Only valid email or URL accepted! You provided: ' . $string
        );
    }
public function notify ( $ string ) { if ( filter_var ( $ string , FILTER_VALIDATE_EMAIL ) ) { $ this -> otherOptions [ 'notifyEmail' ] = $ string ; return $ this ; } if ( filter_var ( $ string , FILTER_VALIDATE_URL ) ) { $ this -> otherOptions [ 'notifyWebhook' ] = urlencode ( $ string ) ; return $ this ; } throw new InvalidArgumentException ( 'Only valid email or URL accepted! You provided: ' . $ string ) ; }
If input is email address, end a message to this email address when the
crawl hits the maxToCrawl or maxToProcess limit, or when the crawl
completes.

If input is URL, you will receive a POST with X-Crawl-Name and
X-Crawl-Status in the headers, and the full JSON response in the
POST body.

@param string $string
@return $this
@throws InvalidArgumentException
If input is email address end a message to this email address when the crawl hits the maxToCrawl or maxToProcess limit or when the crawl completes .