Documentation

CRM_Mailing_ActionTokens extends AbstractTokenSubscriber
in package

Class CRM_Mailing_ActionTokens

Generate "action.*" tokens for mailings.

To activate these tokens, the TokenProcessor context must specify: "mailingJobId" (int) "mailingActionTarget" (array) with keys: 'id' => int, event queue ID 'hash' => string, event queue hash code 'contact_id' => int, contact_id, 'email' => string, email 'phone' => string, phone

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()  : mixed
To perform a bulk lookup before rendering tokens, override this function and return the prefetched data.
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);

$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
inheritDoc
Return values
bool

evaluateToken()

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
inheritDoc

        
On this page

Search results