public function Email::applyTokens in Courier 2.x
Same name and namespace in other branches
- 8 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 119
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;
}