You are here

protected function EmailSender::replaceTokens in Commerce Email 8

Replaces tokens in the given value.

Parameters

string $value: The value.

\Drupal\Core\Entity\ContentEntityInterface $entity: The entity to use for token replacements.

Return value

string The value with tokens replaced.

1 call to EmailSender::replaceTokens()
EmailSender::send in src/EmailSender.php
Sends the given email.

File

src/EmailSender.php, line 81

Class

EmailSender

Namespace

Drupal\commerce_email

Code

protected function replaceTokens($value, ContentEntityInterface $entity) {
  if (!empty($value)) {
    $value = $this->token
      ->replace($value, [
      $entity
        ->getEntityTypeId() => $entity,
    ]);
  }
  return $value;
}