public function MailEntity::getTokenContext in Simplenews 3.x
Same name and namespace in other branches
- 8.2 src/Mail/MailEntity.php \Drupal\simplenews\Mail\MailEntity::getTokenContext()
- 8 src/Mail/MailEntity.php \Drupal\simplenews\Mail\MailEntity::getTokenContext()
Returns the token context to be used with token replacements.
Return value
array An array of objects as required by token_replace().
Overrides MailInterface::getTokenContext
3 calls to MailEntity::getTokenContext()
- MailEntity::getBodyWithFormat in src/
Mail/ MailEntity.php - Get the body with the requested format.
- MailEntity::getHeaders in src/
Mail/ MailEntity.php - Returns the mail headers.
- MailEntity::getSubject in src/
Mail/ MailEntity.php - Returns the mail subject.
File
- src/
Mail/ MailEntity.php, line 147
Class
- MailEntity
- Default mail class for entities.
Namespace
Drupal\simplenews\MailCode
public function getTokenContext() {
return [
'newsletter' => $this
->getNewsletter(),
'simplenews_subscriber' => $this
->getSubscriber(),
$this
->getIssue()
->getEntityTypeId() => $this
->getIssue(),
];
}