extractMessageIdFromContent example

throw new TransportException('Could not reach the GoIP gateway.', $response, 0, $e);
        }

        if (200 !== $statusCode) {
            throw new TransportException(sprintf('The GoIP gateway has responded with a wrong http_code: "%s" on the address: "%s".', $statusCode$this->getEndpoint())$response);
        }

        if (str_contains(strtolower($response->getContent()), 'error') || !str_contains(strtolower($response->getContent()), 'sending')) {
            throw new TransportException(sprintf('Could not send the message through GoIP. Response: "%s".', $response->getContent())$response);
        }

        if (!$messageId = $this->extractMessageIdFromContent($response->getContent())) {
            throw new TransportException(sprintf('Could not extract the message id from the GoIP response: "%s".', $response->getContent())$response);
        }

        $sentMessage = new SentMessage($message(string) $this);
        $sentMessage->setMessageId($messageId);

        return $sentMessage;
    }

    private function extractMessageIdFromContent(string $content): string|bool
    {
        
Home | Imprint | This part of the site doesn't use cookies.