You are here

public function MailTest::getBody in Simplenews 3.x

Same name and namespace in other branches
  1. 8.2 src/Mail/MailTest.php \Drupal\simplenews\Mail\MailTest::getBody()
  2. 8 src/Mail/MailTest.php \Drupal\simplenews\Mail\MailTest::getBody()

Returns the mail body.

Return value

string The body, as plaintext or html depending on the format.

Overrides MailInterface::getBody

File

src/Mail/MailTest.php, line 45

Class

MailTest
Example mail implementation used for tests.

Namespace

Drupal\simplenews\Mail

Code

public function getBody() {
  return $this
    ->getFormat() == 'plain' ? $this
    ->getPlainBody() : 'the body';
}