class CRM_Mailing_Tokens extends AbstractTokenSubscriber

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).

Properties

string $entity from AbstractTokenSubscriber
array $tokenNames from AbstractTokenSubscriber
array $activeTokens from AbstractTokenSubscriber

Methods

static 
getSubscribedEvents()

No description

__construct()

Class constructor.

bool
checkActive(TokenProcessor $processor)

No description

registerTokens(TokenRegisterEvent $e)

Register the declared tokens.

alterActionScheduleQuery(MailingQueryEvent $e)

Alter the query which prepopulates mailing data for scheduled reminders.

evaluateTokens(TokenValueEvent $e)

Populate the token data.

mixed
getActiveTokens(TokenValueEvent $e)

To handle variable tokens, override this function and return the active tokens.

mixed
prefetch(TokenValueEvent $e)

Prefetch tokens.

mixed
evaluateToken(TokenRow $row, string $entity, string $field, mixed $prefetch = NULL)

No description

Details

static getSubscribedEvents()

at line 42
__construct()

Class constructor.

at line 63
bool checkActive(TokenProcessor $processor)

Parameters

TokenProcessor $processor

Return Value

bool

registerTokens(TokenRegisterEvent $e)

Register the declared tokens.

Parameters

TokenRegisterEvent $e The registration event. Add new tokens using register().

alterActionScheduleQuery(MailingQueryEvent $e)

Alter the query which prepopulates mailing data for scheduled reminders.

This is method is not always appropriate, but if you're specifically focused on scheduled reminders, it can be convenient.

Parameters

MailingQueryEvent $e The pending query which may be modified. See discussion on MailingQueryEvent::$query.

evaluateTokens(TokenValueEvent $e)

Populate the token data.

Parameters

TokenValueEvent $e The event, which includes a list of rows and tokens.

mixed getActiveTokens(TokenValueEvent $e)

To handle variable tokens, override this function and return the active tokens.

Parameters

TokenValueEvent $e

Return Value

mixed

at line 76
mixed prefetch(TokenValueEvent $e)

Prefetch tokens.

Parameters

TokenValueEvent $e

Return Value

mixed

Exceptions

Exception

at line 90
mixed evaluateToken(TokenRow $row, string $entity, string $field, mixed $prefetch = NULL)

Parameters

TokenRow $row The record for which we want token values.
string $entity The name of the token entity.
string $field The name of the token field.
mixed $prefetch Any data that was returned by the prefetch().

Return Value

mixed