You are here

protected function FormatTest::extractBody in Swift Mailer 8.2

Returns the HTML body from a message (contents of <body> tag).

2 calls to FormatTest::extractBody()
FormatTest::testCss in tests/src/Kernel/Plugin/Mail/FormatTest.php
Tests messages with CSS.
FormatTest::testFormat in tests/src/Kernel/Plugin/Mail/FormatTest.php
Tests formatting the message.

File

tests/src/Kernel/Plugin/Mail/FormatTest.php, line 159

Class

FormatTest
@coversDefaultClass \Drupal\swiftmailer\Plugin\Mail\SwiftMailer @group swiftmailer

Namespace

Drupal\Tests\swiftmailer\Kernel\Plugin\Mail

Code

protected function extractBody($message) {
  preg_match('|<html><body>(.*)</body></html>|s', $message['body'], $matches);
  return trim($matches[1]);
}