protected function getSupportMessages(Result $result)
    {
        $messages = array(
            'text' => '',
            'html' => '',
        );

        $pluginSettings = $this->config->getPluginSettings();
        // We add the request and response messages when set so or if there were
        // warnings or severer messages, thus not with notices.
        $addReqResp = $pluginSettings['debug'] === PluginConfig::Send_SendAndMailOnError ? Result::AddReqResp_WithOther : Result::AddReqResp_Always;
        if ($addReqResp === Result::AddReqResp_Always || ($addReqResp === Result::AddReqResp_WithOther && $result->getStatus() >= Result::Status_Warnings)) {
            if ($result->getRawRequest() !== null || $result->getRawResponse() !== null) {
                $header = $this->t('mail_support_header');
                $description = $this->t('mail_support_desc');
                $supportMessagesText = $result->getRawRequestResponse(Result::Format_FormattedText);
                $supportMessagesHtml = $result->getRawRequestResponse(Result::Format_Html);
                $messages = array(
                    'text' => "\n$header\n\n$description\n\n$supportMessagesText\n",
                    'html' => "<details><summary>$header</summary><p>$description</p>$supportMessagesHtml</details>",
                );
            }
        }
        return $messages;
    }