CRM_Mailing_Tokens
extends AbstractTokenSubscriber
in package
Class CRM_Mailing_Tokens
Generate "mailing.*" tokens.
To activate these tokens, the TokenProcessor context must specify either "mailingId" (int) or "mailing" (CRM_Mailing_BAO_Mailing).
Table of Contents
Properties
- $activeTokens : array<string|int, mixed>
- $entity : string
- $tokenNames : array<string|int, mixed>
Methods
- __construct() : mixed
- Class constructor.
- alterActionScheduleQuery() : mixed
- Alter the query which prepopulates mailing data for scheduled reminders.
- checkActive() : bool
- Determine whether this token-handler should be used with the given processor.
- evaluateToken() : mixed
- Evaluate the content of a single token.
- evaluateTokens() : mixed
- Populate the token data.
- getActiveTokens() : mixed
- To handle variable tokens, override this function and return the active tokens.
- getSubscribedEvents() : mixed
- prefetch() : array<string|int, mixed>
- Prefetch tokens.
- registerTokens() : mixed
- Register the declared tokens.
Properties
$activeTokens
public
array<string|int, mixed>
$activeTokens
List of active tokens - tokens provided by this class and used in the message Array(string $tokenName);
$entity
public
string
$entity
Ex: 'contact' or profile' or 'employer'
$tokenNames
public
array<string|int, mixed>
$tokenNames
List of tokens provided by this class Array(string $fieldName => string $label).
Methods
__construct()
Class constructor.
public
__construct() : mixed
alterActionScheduleQuery()
Alter the query which prepopulates mailing data for scheduled reminders.
public
alterActionScheduleQuery(MailingQueryEvent $e) : mixed
This is method is not always appropriate, but if you're specifically focused on scheduled reminders, it can be convenient.
Parameters
- $e : MailingQueryEvent
-
The pending query which may be modified. See discussion on MailingQueryEvent::$query.
checkActive()
Determine whether this token-handler should be used with the given processor.
public
checkActive(TokenProcessor $processor) : bool
Parameters
- $processor : TokenProcessor
Tags
Return values
boolevaluateToken()
Evaluate the content of a single token.
public
evaluateToken(TokenRow $row, mixed $entity, mixed $field[, mixed $prefetch = NULL ]) : mixed
Parameters
- $row : TokenRow
-
The record for which we want token values.
- $entity : mixed
-
The name of the token entity.
- $field : mixed
-
The name of the token field.
- $prefetch : mixed = NULL
-
Any data that was returned by the prefetch().
Tags
evaluateTokens()
Populate the token data.
public
evaluateTokens(TokenValueEvent $e) : mixed
Parameters
- $e : TokenValueEvent
-
The event, which includes a list of rows and tokens.
getActiveTokens()
To handle variable tokens, override this function and return the active tokens.
public
getActiveTokens(TokenValueEvent $e) : mixed
Parameters
- $e : TokenValueEvent
getSubscribedEvents()
public
static getSubscribedEvents() : mixed
prefetch()
Prefetch tokens.
public
prefetch(TokenValueEvent $e) : array<string|int, mixed>
Parameters
- $e : TokenValueEvent
Tags
Return values
array<string|int, mixed>registerTokens()
Register the declared tokens.
public
registerTokens(TokenRegisterEvent $e) : mixed
Parameters
- $e : TokenRegisterEvent
-
The registration event. Add new tokens using register().