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
$htmlPath
private
string
$htmlPath
$logger
private
LoggerInterface
$logger
= new ErrorLogFallbackLogger()
$plainPath
private
string|null
$plainPath
= null
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
boolrender()
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
stringrenderPlain()
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|nullrenderFile()
private
renderFile(string $path, array<string|int, mixed> $data) : string
Parameters
- $path : string
- $data : array<string|int, mixed>