Documentation

EmailTemplate
in package

Read onlyYes
FinalYes

Table of Contents

Properties

$htmlPath  : string
$logger  : LoggerInterface
$plainPath  : string|null

Methods

__construct()  : mixed
hasPlainVersion()  : bool
Check if a plain text version is available.
render()  : string
Render the HTML template with the given data. The data is exposed to the template as a single `$view` array (e.g. `$view['name']`), never as extracted locals.
renderPlain()  : string|null
Render the plain text version (if available).
renderFile()  : string

Properties

$logger

private LoggerInterface $logger = new ErrorLogFallbackLogger()

Methods

__construct()

public __construct(string $htmlPath[, string|null $plainPath = null ][, LoggerInterface $logger = new ErrorLogFallbackLogger() ]) : mixed
Parameters
$htmlPath : string
$plainPath : string|null = null
$logger : LoggerInterface = new ErrorLogFallbackLogger()

hasPlainVersion()

Check if a plain text version is available.

public hasPlainVersion() : bool
Return values
bool

render()

Render the HTML template with the given data. The data is exposed to the template as a single `$view` array (e.g. `$view['name']`), never as extracted locals.

public render([array<string|int, mixed> $data = [] ]) : string
Parameters
$data : array<string|int, mixed> = []
Return values
string

renderPlain()

Render the plain text version (if available).

public renderPlain([array<string|int, mixed> $data = [] ]) : string|null
Parameters
$data : array<string|int, mixed> = []
Return values
string|null

renderFile()

private renderFile(string $path, array<string|int, mixed> $data) : string
Parameters
$path : string
$data : array<string|int, mixed>
Return values
string
On this page

Search results