Email
extends OutputRemote
in package
Class Email
Outputs the results as an email.
Table of Contents
- $id : mixed
- Processor ID.
- $data : DataContainer
- The output data.
- $details : array<string|int, mixed>
- {@inheritDoc}
- $logger : MonologWrapper
- Logger object.
- $meta : array<string|int, mixed>
- Metadata for the processor.
- $request : Request
- All the request details.
- $settings : Config
- $transport : mixed
- __construct() : mixed
- {@inheritDoc}
- details() : array<string|int, mixed>
- Return details for processor.
- process() : DataContainer
- Main processor function.
- val() : mixed|DataContainer
- Process a variable into a final result for the processor.
- castData() : void
- Cast the data to email.
- isDataContainer() : bool
- Validate if a set of data is wrapped in a DataContainer object.
- validateAllowedTypes() : void
- Validate an input for allowed variable types
- validateAllowedValues() : void
- Validate an input for allowed values.
Properties
$id
Processor ID.
public
mixed
$id
= ''
Processor ID.
$data
The output data.
protected
DataContainer
$data
The output data.
$details
{@inheritDoc}
protected
array<string|int, mixed>
$details
= ['name' => 'Email', 'machineName' => 'email', 'description' => 'Output the results of the resource into an email.', 'menu' => 'Output', 'input' => ['to' => ['description' => 'The destination email/s for the output.', 'cardinality' => [1, '*'], 'literalAllowed' => true, 'limitProcessors' => [], 'limitTypes' => ['text'], 'limitValues' => [], 'default' => ''], 'cc' => ['description' => 'The cc email/s for the output.', 'cardinality' => [0, '*'], 'literalAllowed' => true, 'limitProcessors' => [], 'limitTypes' => ['text'], 'limitValues' => [], 'default' => ''], 'bcc' => ['description' => 'The bcc email/s for the output.', 'cardinality' => [0, '*'], 'literalAllowed' => true, 'limitProcessors' => [], 'limitTypes' => ['text'], 'limitValues' => [], 'default' => ''], 'from' => ['description' => 'The from email/s.', 'cardinality' => [0, '*'], 'literalAllowed' => true, 'limitProcessors' => [], 'limitTypes' => ['text'], 'limitValues' => [], 'default' => ''], 'reply_to' => ['description' => 'The reply-to email.', 'cardinality' => [0, 1], 'literalAllowed' => true, 'limitProcessors' => [], 'limitTypes' => ['text'], 'limitValues' => [], 'default' => ''], 'subject' => ['description' => 'The subject for the email.', 'cardinality' => [1, 1], 'literalAllowed' => true, 'limitProcessors' => [], 'limitTypes' => ['text'], 'limitValues' => [], 'default' => ''], 'text' => ['description' => 'The body "text" fallback if using HTML email.', 'cardinality' => [0, 1], 'literalAllowed' => true, 'limitProcessors' => [], 'limitTypes' => ['text'], 'limitValues' => [], 'default' => '']]]
Details of the processor.
$logger
Logger object.
protected
MonologWrapper
$logger
$meta
Metadata for the processor.
protected
array<string|int, mixed>
$meta
$request
All the request details.
protected
Request
$request
Request.
$settings
protected
Config
$settings
Config object.
$transport
protected
mixed
$transport
Transport class.
Methods
__construct()
{@inheritDoc}
public
__construct(array<string|int, mixed> &$meta, Request &$request, MonologWrapper|null $logger, mixed $data) : mixed
Parameters
- $meta : array<string|int, mixed>
- $request : Request
- $logger : MonologWrapper|null
- $data : mixed
Return values
mixed —details()
Return details for processor.
public
details() : array<string|int, mixed>
Return values
array<string|int, mixed> —process()
Main processor function.
public
process() : DataContainer
Tags
Return values
DataContainer —Result of the processor.
val()
Process a variable into a final result for the processor.
public
val(string $key[, bool|null $rawData = false ]) : mixed|DataContainer
This method can be used to process a value in its meta to return a final result that it can use. If the object is a processor, then it will process that down to a final return value, or if the obj is a simple value, then it will return that. Anything else will return an error object.
Setting $realValue to true will force the value to be the actual value, rather than a potential dataContainer.
Parameters
- $key : string
-
The key for the input variable in the meta.
- $rawData : bool|null = false
-
Return the raw data or a DataContainer.
Tags
Return values
mixed|DataContainer —castData()
Cast the data to email.
protected
castData() : void
Nothing to do here.
Return values
void —isDataContainer()
Validate if a set of data is wrapped in a DataContainer object.
protected
isDataContainer(mixed $data) : bool
Parameters
- $data : mixed
-
DataContainer or raw data.
Return values
bool —validateAllowedTypes()
Validate an input for allowed variable types
private
validateAllowedTypes(string $type, array<string|int, mixed> $limitTypes, int $min, string $key) : void
Parameters
- $type : string
-
Input value type.
- $limitTypes : array<string|int, mixed>
-
List of limit on variable types.
- $min : int
-
Minimum number of values.
- $key : string
-
The key of the input being validated.
Tags
Return values
void —validateAllowedValues()
Validate an input for allowed values.
private
validateAllowedValues(mixed $val, array<string|int, mixed> $limitValues, int $min, string $key) : void
Parameters
- $val : mixed
-
Input value.
- $limitValues : array<string|int, mixed>
-
List of allowed values.
- $min : int
-
Minimum number of values.
- $key : string
-
The key of the input being validated.