Commit 37ee9a15 authored by sv's avatar sv Committed by Taras Kruts
Browse files

Issue #3255434 by SV: Use label instead of machine name of content type in the...

Issue #3255434 by SV: Use label instead of machine name of content type in the token replacement. (#2665)
parent e00efa51
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -128,13 +128,18 @@ class EmailTokenServices {
      $date = _social_event_format_date($node, NULL);
    }

    /** @var \Drupal\node\NodeTypeInterface $node_type */
    $node_type = $this->entityTypeManager
      ->getStorage('node_type')
      ->load($node->bundle());

    // Prepare the preview.
    $preview_info = [
      '#theme' => 'message_content_preview',
      '#author_name' => $node->getOwner()->getDisplayName(),
      '#date' => $date,
      '#title' => $node->getTitle(),
      '#type' => strtoupper($node->getType()),
      '#type' => mb_strtoupper((string) $node_type->label()),
      '#link' => $link,
    ];