class MailManager

Traits

Singleton trait.

Properties

static protected $instance from  Singleton
protected array $templateCache
protected array $callbacks
protected array $registeredTemplates
protected array $registeredPartials
protected array $registeredLayouts
protected array $registeredVariables
protected bool $isRenderingHtml
protected array $partialStack

The partials being rendered.

protected array $partialData

The original data passed to the partial.

Methods

static 
instance()

Create a new instance of this singleton.

static 
forgetInstance()

Forget this singleton's instance if it exists

__construct()

Constructor.

initialize()

Initialize the singleton free from constructor parameters.

__clone()

No description

__wakeup()

No description

addContentToMailer($message, $code, $data, $plainOnly = false)

No description

addRawContentToMailer($message, $content, $data)

No description

applyMailerConfigValues()

No description

bool
addContentToMailerInternal(Message $message, $template, $data, bool $plainOnly = false)

No description

string
render(string $content, array $data = [])

Render the Markdown template into HTML.

string
renderText($content, array $data = [])

Render the Markdown template into text.

renderTemplate($template, $data = [])

No description

renderTextTemplate($template, $data = [])

No description

renderView($content, $data)

No description

startPartial($code, array $params = [])

No description

renderPartial()

No description

void
loadRegisteredTemplates()

Loads registered templates from extensions

array
listRegisteredLayouts()

Returns a list of the registered layouts.

array
listRegisteredTemplates()

Returns a list of the registered templates.

array
listRegisteredPartials()

Returns a list of the registered partials.

array
listRegisteredVariables()

Returns a list of the registered variables.

registerMailLayouts(array $definitions)

Registers mail views and manageable layouts.

registerMailTemplates(array $definitions)

Registers mail views and manageable templates.

registerMailPartials(array $definitions)

Registers mail views and manageable partials.

registerMailVariables(array $definitions)

Registers mail variables.

registerCallback(callable $callback)

Registers a callback function that defines templates.

registerBladeDirectives()

No description

processRegistrationMethodValues($extension, $method)

No description

Details

in Singleton at line 18
final static instance()

Create a new instance of this singleton.

in Singleton at line 28
final static forgetInstance()

Forget this singleton's instance if it exists

in Singleton at line 36
final protected __construct()

Constructor.

in Singleton at line 44
protected initialize()

Initialize the singleton free from constructor parameters.

in Singleton at line 48
__clone()

No description

in Singleton at line 53
__wakeup()

No description

at line 70
addContentToMailer($message, $code, $data, $plainOnly = false)

No description

Parameters

$message
$code
$data
$plainOnly

at line 84
addRawContentToMailer($message, $content, $data)

No description

Parameters

$message
$content
$data

at line 93
applyMailerConfigValues()

No description

at line 137
protected bool addContentToMailerInternal(Message $message, $template, $data, bool $plainOnly = false)

No description

Parameters

Message $message
$template
$data
bool $plainOnly

Return Value

bool

at line 176
string render(string $content, array $data = [])

Render the Markdown template into HTML.

Parameters

string $content
array $data

Return Value

string

at line 194
string renderText($content, array $data = [])

Render the Markdown template into text.

Parameters

$content
array $data

Return Value

string

at line 207
renderTemplate($template, $data = [])

No description

Parameters

$template
$data

at line 226
renderTextTemplate($template, $data = [])

No description

Parameters

$template
$data

at line 247
protected renderView($content, $data)

No description

Parameters

$content
$data

at line 256
startPartial($code, array $params = [])

No description

Parameters

$code
array $params

at line 266
renderPartial()

No description

at line 295
void loadRegisteredTemplates()

Loads registered templates from extensions

Return Value

void

at line 313
array listRegisteredLayouts()

Returns a list of the registered layouts.

Return Value

array

at line 325
array listRegisteredTemplates()

Returns a list of the registered templates.

Return Value

array

at line 337
array listRegisteredPartials()

Returns a list of the registered partials.

Return Value

array

at line 349
array listRegisteredVariables()

Returns a list of the registered variables.

Return Value

array

at line 361
registerMailLayouts(array $definitions)

Registers mail views and manageable layouts.

Parameters

array $definitions

at line 374
registerMailTemplates(array $definitions)

Registers mail views and manageable templates.

Parameters

array $definitions

at line 387
registerMailPartials(array $definitions)

Registers mail views and manageable partials.

Parameters

array $definitions

at line 400
registerMailVariables(array $definitions)

Registers mail variables.

Parameters

array $definitions

at line 422
registerCallback(callable $callback)

Registers a callback function that defines templates.

The callback function should register templates by calling the manager's registerMailTemplates() function. This instance is passed to the callback function as an argument. Usage:

  MailManager::instance()->registerCallback(function($manager){
      $manager->registerMailTemplates([...]);
  });

Parameters

callable $callback

A callable function.

at line 427
protected registerBladeDirectives()

No description

at line 438
protected processRegistrationMethodValues($extension, $method)

No description

Parameters

$extension
$method