You are here

protected function WorkbenchEmailProcessor::checkMarkup in Workbench Email 8

Same name and namespace in other branches
  1. 2.x src/Plugin/QueueWorker/WorkbenchEmailProcessor.php \Drupal\workbench_email\Plugin\QueueWorker\WorkbenchEmailProcessor::checkMarkup()

Converts message body to markup applying filter.

Parameters

string $text: Text to filter.

string $format_id: Format ID.

string $langcode: Langcode.

Return value

\Drupal\Component\Render\MarkupInterface Filtered markup.

1 call to WorkbenchEmailProcessor::checkMarkup()
WorkbenchEmailProcessor::processItem in src/Plugin/QueueWorker/WorkbenchEmailProcessor.php
Works on a single queue item.

File

src/Plugin/QueueWorker/WorkbenchEmailProcessor.php, line 161

Class

WorkbenchEmailProcessor
Sends emails notifications for workbench events.

Namespace

Drupal\workbench_email\Plugin\QueueWorker

Code

protected function checkMarkup($text, $format_id, $langcode = LanguageInterface::LANGCODE_DEFAULT) {
  $build = [
    '#type' => 'processed_text',
    '#text' => $text,
    '#format' => $format_id,
    '#filter_types_to_skip' => [],
    '#langcode' => $langcode,
  ];
  return $this->renderer
    ->renderPlain($build);
}