You are here

protected function YamlFormElementFormatTest::getMessageBody in YAML Form 8

Get form email message body for a form submission.

Parameters

\Drupal\yamlform\YamlFormSubmissionInterface $submission: A form submission.

string $handler_id: The form email handler id.

Return value

string The form email message body for a form submission.

1 call to YamlFormElementFormatTest::getMessageBody()
YamlFormElementFormatTest::testElementFormat in src/Tests/YamlFormElementFormatTest.php
Tests element format.

File

src/Tests/YamlFormElementFormatTest.php, line 210

Class

YamlFormElementFormatTest
Tests for form submission form element custom #format support.

Namespace

Drupal\yamlform\Tests

Code

protected function getMessageBody(YamlFormSubmissionInterface $submission, $handler_id = 'email_html') {

  /** @var \Drupal\yamlform\YamlFormHandlerMessageInterface $message_handler */
  $message_handler = $submission
    ->getYamlForm()
    ->getHandler($handler_id);
  $message = $message_handler
    ->getMessage($submission);
  $body = (string) $message['body'];
  $this
    ->verbose($body);
  return $body;
}