src/Helpers/Mailer.php
protected function getMessages(Result $result)
    {
        $messages = array(
            'text' => '',
            'html' => '',
        );

        if ($result->hasMessages()) {
            $header = $this->t('mail_messages_header');
            $description = $this->t('mail_messages_desc');
            $descriptionHtml = $this->t('mail_messages_desc_html');
            $messagesText = $result->getMessages(Result::Format_FormattedText);
            $messagesHtml = $result->getMessages(Result::Format_Html);
            $messages = array(
                'text' => "\n$header\n\n$messagesText\n\n$description\n",
                'html' => "<details open><summary>$header</summary>$messagesHtml<p>$descriptionHtml</p></details>",
            );
        }
        return $messages;
    }
protected function getMessages(Result $result)
    {
        $messages = array(
            'text' => '',
            'html' => '',
        );

        if ($result->hasMessages()) {
            $header = $this->t('mail_messages_header');
            $description = $this->t('mail_messages_desc');
            $descriptionHtml = $this->t('mail_messages_desc_html');
            $messagesText = $result->getMessages(Result::Format_FormattedText);
            $messagesHtml = $result->getMessages(Result::Format_Html);
            $messages = array(
                'text' => "\n$header\n\n$messagesText\n\n$description\n",
                'html' => "<details open><summary>$header</summary>$messagesHtml<p>$descriptionHtml</p></details>",
            );
        }
        return $messages;
    }
protected function getMessages ( Result $ result ) { $ messages = array ( 'text' => '' , 'html' => '' , ) ; if ( $ result -> hasMessages ( ) ) { $ header = $ this -> t ( 'mail_messages_header' ) ; $ description = $ this -> t ( 'mail_messages_desc' ) ; $ descriptionHtml = $ this -> t ( 'mail_messages_desc_html' ) ; $ messagesText = $ result -> getMessages ( Result :: Format_FormattedText ) ; $ messagesHtml = $ result -> getMessages ( Result :: Format_Html ) ; $ messages = array ( 'text' => "\n$header\n\n$messagesText\n\n$description\n" , 'html' => "<details open><summary>$header</summary>$messagesHtml<p>$descriptionHtml</p></details>" , ) ; } return $ messages ; }
Returns the  messages along with some descriptive text.

@param \Siel\Acumulus\Invoice\Result $result

@return string[]
An array with a plain text (key='text') and an html string (key='html')
containing the messages with some descriptive text.
Returns the messages along with some descriptive text .