src/Checkout/OrderEmailNotifier.php
protected function debug(Email $email)
    {
        $email->render();
        $template = $email->getHTMLTemplate();
        $headers = $email->getSwiftMessage()->getHeaders()->toString();

        return "<h2>Email HTML template: $template</h2>\n" .
            "<pre>$headers</pre>" .
            $email->getBody();
    }
protected function debug(Email $email)
    {
        $email->render();
        $template = $email->getHTMLTemplate();
        $headers = $email->getSwiftMessage()->getHeaders()->toString();

        return "<h2>Email HTML template: $template</h2>\n" .
            "<pre>$headers</pre>" .
            $email->getBody();
    }
The new Email::debug method in SilverStripe dumps the entire message with all message parts,
which makes it unusable to preview an Email.
This method simulates the old way of the message output and renders only the HTML body.

@param Email $email
@return string