src/Helpers/Mailer.php
protected function getBody(Result $result, $invoiceSourceType, $invoiceSourceReference)
    {
        $resultInvoice = $result->getResponse();
        $bodyTexts = $this->getStatusSpecificBody($result);
        $supportTexts = $this->getSupportMessages($result);
        $messagesTexts = $this->getMessages($result);
        $replacements = array(
            '{invoice_source_type}' => $this->t($invoiceSourceType),
            '{invoice_source_reference}' => $invoiceSourceReference,
            '{acumulus_invoice_id}' => isset($resultInvoice['invoicenumber']) ? $resultInvoice['invoicenumber'] : $this->t('message_no_invoice'),
            '{status}' => $result->getStatus(),
            '{status_message}' => $result->getStatusText(),
            '{status_specific_text}' => $bodyTexts['text'],
            '{status_specific_html}' => $bodyTexts['html'],
            '{messages_text}' => $messagesTexts['text'],
            '{messages_html}' => $messagesTexts['html'],
            '{support_messages_text}' => $supportTexts['text'],
            '{support_messages_html}' => $supportTexts['html'],
        );
        $text = $this->t('mail_text');
        $text = strtr($text, $replacements);
        $html = $this->t('mail_html');
        $html = strtr($html, $replacements);
        return array('text' => $text, 'html' => $html);
    }
protected function getBody(Result $result, $invoiceSourceType, $invoiceSourceReference)
    {
        $resultInvoice = $result->getResponse();
        $bodyTexts = $this->getStatusSpecificBody($result);
        $supportTexts = $this->getSupportMessages($result);
        $messagesTexts = $this->getMessages($result);
        $replacements = array(
            '{invoice_source_type}' => $this->t($invoiceSourceType),
            '{invoice_source_reference}' => $invoiceSourceReference,
            '{acumulus_invoice_id}' => isset($resultInvoice['invoicenumber']) ? $resultInvoice['invoicenumber'] : $this->t('message_no_invoice'),
            '{status}' => $result->getStatus(),
            '{status_message}' => $result->getStatusText(),
            '{status_specific_text}' => $bodyTexts['text'],
            '{status_specific_html}' => $bodyTexts['html'],
            '{messages_text}' => $messagesTexts['text'],
            '{messages_html}' => $messagesTexts['html'],
            '{support_messages_text}' => $supportTexts['text'],
            '{support_messages_html}' => $supportTexts['html'],
        );
        $text = $this->t('mail_text');
        $text = strtr($text, $replacements);
        $html = $this->t('mail_html');
        $html = strtr($html, $replacements);
        return array('text' => $text, 'html' => $html);
    }
protected function getBody ( Result $ result , $ invoiceSourceType , $ invoiceSourceReference ) { $ resultInvoice = $ result -> getResponse ( ) ; $ bodyTexts = $ this -> getStatusSpecificBody ( $ result ) ; $ supportTexts = $ this -> getSupportMessages ( $ result ) ; $ messagesTexts = $ this -> getMessages ( $ result ) ; $ replacements = array ( '{invoice_source_type}' => $ this -> t ( $ invoiceSourceType ) , '{invoice_source_reference}' => $ invoiceSourceReference , '{acumulus_invoice_id}' => isset ( $ resultInvoice [ 'invoicenumber' ] ) ? $ resultInvoice [ 'invoicenumber' ] : $ this -> t ( 'message_no_invoice' ) , '{status}' => $ result -> getStatus ( ) , '{status_message}' => $ result -> getStatusText ( ) , '{status_specific_text}' => $ bodyTexts [ 'text' ] , '{status_specific_html}' => $ bodyTexts [ 'html' ] , '{messages_text}' => $ messagesTexts [ 'text' ] , '{messages_html}' => $ messagesTexts [ 'html' ] , '{support_messages_text}' => $ supportTexts [ 'text' ] , '{support_messages_html}' => $ supportTexts [ 'html' ] , ) ; $ text = $ this -> t ( 'mail_text' ) ; $ text = strtr ( $ text , $ replacements ) ; $ html = $ this -> t ( 'mail_html' ) ; $ html = strtr ( $ html , $ replacements ) ; return array ( 'text' => $ text , 'html' => $ html ) ; }
Returns the mail body as text and as html.

@param \Siel\Acumulus\Invoice\Result $result
@param string $invoiceSourceType
@param string $invoiceSourceReference

@return string[]
An array with keys text and html.
Returns the mail body as text and as html .