Documentation

DefaultComposer extends AutoService uses IsActiveTrait

Class DefaultComposer

Tags
service

civi_flexmailer_default_composer

Table of Contents

Properties

$active  : bool

Methods

createMailParams()  : array<string|int, mixed>
For a given task, prepare the mailing.
createMessageTemplates()  : array<string|int, mixed>
Generate the message templates for use with token-processor.
createTokenProcessorContext()  : array<string|int, mixed>
Define the contextual parameters for the token-processor.
createTokenRowContext()  : array<string|int, mixed>
Create contextual data for a message recipient.
isActive()  : bool
isClickTracking()  : bool
Determine whether to enable click-tracking.
isSupported()  : bool
Determine whether this composer knows how to handle this mailing.
onCompose()  : mixed
Given a mailing and a batch of recipients, prepare the individual messages (headers and body) for each.
onRun()  : mixed
setActive()  : $this
applyClickTracking()  : array<string|int, mixed>
(Tentative) Alter hyperlinks to perform click-tracking.

Properties

Methods

createMessageTemplates()

Generate the message templates for use with token-processor.

public createMessageTemplates(ComposeBatchEvent $e) : array<string|int, mixed>
Parameters
$e : ComposeBatchEvent
Return values
array<string|int, mixed>

A list of templates. Some combination of:

  • subject: string
  • html: string
  • text: string

createTokenProcessorContext()

Define the contextual parameters for the token-processor.

public createTokenProcessorContext(ComposeBatchEvent $e) : array<string|int, mixed>
Parameters
$e : ComposeBatchEvent
Return values
array<string|int, mixed>

setActive()

public setActive(bool $active) : $this
Parameters
$active : bool
Return values
$this

applyClickTracking()

(Tentative) Alter hyperlinks to perform click-tracking.

protected applyClickTracking(ComposeBatchEvent $e, array<string|int, mixed> $templates) : array<string|int, mixed>

This functionality probably belongs somewhere else. The current placement feels quirky, and it's hard to inspect via `cv debug:event-dispatcher', but it produces the expected interactions among tokens and click-tracking.

Parameters
$e : ComposeBatchEvent
$templates : array<string|int, mixed>
Return values
array<string|int, mixed>

Updated templates.


        
On this page

Search results