public function Email::applyTokens in Courier 8
Same name and namespace in other branches
- 2.x src/Entity/Email.php \Drupal\courier\Entity\Email::applyTokens()
Applies tokens to relevant fields.
Return value
static Return this instance for chaining.
Overrides ChannelInterface::applyTokens
File
- src/
Entity/ Email.php, line 124 - Contains \Drupal\courier\Entity\Email.
Class
- Defines storage for a composed email.
Namespace
Drupal\courier\EntityCode
public function applyTokens() {
$tokens = $this
->getTokenValues();
$options = $this
->getTokenOptions();
$this
->setSubject(\Drupal::token()
->replace($this
->getSubject(), $tokens, $options));
$this
->setBody(\Drupal::token()
->replace($this
->getBody(), $tokens, $options));
return $this;
}