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
Namespace
Drupal\commerce_emailCode
protected function replaceTokens($value, ContentEntityInterface $entity) {
if (!empty($value)) {
$value = $this->token
->replace($value, [
$entity
->getEntityTypeId() => $entity,
]);
}
return $value;
}